- Timestamp:
- Apr 9, 2010, 10:23:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/map/inc/overlay.js
r7703 r7707 1 1 var map; 2 var geoXml; 3 var toggleState = 1; 2 var marker; 3 var lat; 4 var lon; 5 var latOffset; 6 var lonOffset; 7 var polygon; 4 8 5 6 7 /* 8 function initialize_map() { 9 if (GBrowserIsCompatible()) { 10 geoXml = new GGeoXml("http://www.mantixweb.nl/nodemap/example.kml?tijd=10342"); 9 function nodeAdd() { 10 if (GBrowserIsCompatible()) { 11 11 map = new GMap2(document.getElementById("mapcanvas")); 12 map.setCenter(new GLatLng(52.162687, 4.493294), 1 1);12 map.setCenter(new GLatLng(52.162687, 4.493294), 12); 13 13 map.setUIToDefault(); 14 map.addOverlay(geoXml); 15 } 16 } 14 15 marker = new GMarker(map.getCenter()); 16 GEvent.addListener(marker, "click", function () { 17 marker.openInfoWindowHtml("Test, Test, You suck! Eindelijk, het werkt!!!!"); 18 }); 19 map.addOverlay(marker); 20 21 GEvent.addListener(map, "click", function(overlay,latlng) { 22 lat = latlng.lat(); 23 lon = latlng.lng(); 24 latOffset = 0.01; 25 lonOffset = 0.01; 26 polygon = new GPolygon([ 27 new GLatLng(lat, lon - lonOffset), 28 new GLatLng(lat + latOffset, lon), 29 new GLatLng(lat, lon + lonOffset), 30 new GLatLng(lat - latOffset, lon), 31 new GLatLng(lat, lon - lonOffset) 32 ], "#f33f00", 5, 1, "#ff0000", 0.2); 33 map.addOverlay(polygon); 34 }); 35 36 37 } 38 } 17 39 18 function toggleMyKml() {19 if (toggleState == 1) {20 map.removeOverlay(geoXml);21 toggleState = 0;22 } else {23 map.addOverlay(geoXml);24 toggleState = 1;25 }26 }27 */
Note:
See TracChangeset
for help on using the changeset viewer.