From: <cph...@us...> - 2006-05-01 03:12:12
|
Revision: 44 Author: cphillip Date: 2006-04-30 20:12:06 -0700 (Sun, 30 Apr 2006) ViewCVS: http://svn.sourceforge.net/wnmap/?rev=44&view=rev Log Message: ----------- Update some basics in the port and ensure we center correctly. * web/js/NodeMarker.js (NodeMarker): Just housekeeping to ensure we call the correct constructor. * web/js/nodemap.js (createMap): Ensure we call setCenter() to correctly initialize the map. (instanceOf): Added this function to assist debugging. Modified Paths: -------------- branches/gmap2-port/web/js/NodeMarker.js branches/gmap2-port/web/js/nodemap.js Modified: branches/gmap2-port/web/js/NodeMarker.js =================================================================== --- branches/gmap2-port/web/js/NodeMarker.js 2006-05-01 01:09:56 UTC (rev 43) +++ branches/gmap2-port/web/js/NodeMarker.js 2006-05-01 03:12:06 UTC (rev 44) @@ -22,7 +22,7 @@ icon.iconAnchor = new GPoint(9, 34); icon.infoWindowAnchor = new GPoint(20, 1); - GMarker.call (this, point, icon); + NodeMarker.baseConstructor.call (this, point, icon); break; case 'potential': this.statePretty = "Potential Node"; @@ -32,12 +32,12 @@ icon.iconSize = new GSize(20, 34); icon.iconAnchor = new GPoint(9, 34); icon.infoWindowAnchor = new GPoint(20, 1); - GMarker.call (this, point, icon); + NodeMarker.baseConstructor.call (this, point, icon); break; case 'marker': this.statePretty = "Marker"; - GMarker.call (this, point); + NodeMarker.baseConstructor.call (this, point); this.step = 1; break; default: @@ -45,7 +45,6 @@ return; break; } - this.getHtml = function () { var html = ""; Modified: branches/gmap2-port/web/js/nodemap.js =================================================================== --- branches/gmap2-port/web/js/nodemap.js 2006-05-01 01:09:56 UTC (rev 43) +++ branches/gmap2-port/web/js/nodemap.js 2006-05-01 03:12:06 UTC (rev 44) @@ -20,8 +20,7 @@ map = new GMap2(document.getElementById("mapColumn")); map.addControl(new GLargeMapControl()); map.addControl (new GMapTypeControl()); - // FIXME - // map.centerAndZoom(new GPoint(WNMAP_MAP_START_LON, WNMAP_MAP_START_LAT), parseInt(WNMAP_MAP_START_ZOOM)); + map.setCenter(new GLatLng(WNMAP_MAP_START_LAT, WNMAP_MAP_START_LON), parseInt(WNMAP_MAP_START_ZOOM)); map.setMapType (G_NORMAL_MAP); map.addControl(new GScaleControl()); // GKeyboardHandler(map); // with this on, "this.lg is not a function" @@ -42,8 +41,6 @@ request.onreadystatechange = function () { if (request.readyState == 4) { - var pointTable = []; - var xmlDoc = request.responseXML; // Add Nodes @@ -136,9 +133,7 @@ // Add Markers // inside here: a.initialize is not a function for (var key in markers) { -//alert("key = " + key); var node = markers[key]; -//alert("node = " + node); if (node.state == 'active' && document.getElementById ("showActive").checked == false) { node.visible = false; @@ -283,3 +278,12 @@ } return null; } + +function instanceOf(object, constructorFunction) { + while (object != null) { + if (object == constructorFunction.prototype) + {return true} + object = object.__proto__; + } + return false; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |