From abe77ef759ea6ed82acf76c3a40130747b948c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 24 Jul 2011 14:42:23 +0000 Subject: [PATCH] try to add support for OpenStreetMap; cleanup svn: r17955 --- src/plugins/lib/libhtmlconst.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/plugins/lib/libhtmlconst.py b/src/plugins/lib/libhtmlconst.py index c45d64d75..b20b4176e 100644 --- a/src/plugins/lib/libhtmlconst.py +++ b/src/plugins/lib/libhtmlconst.py @@ -129,28 +129,25 @@ openstreet_jsc = """ function initialize(){ map = new OpenLayers.Map("map_canvas"); - map.addLayer(new OpenLayers.Layer.OSM()); - map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData); - map.addLayer(map.dataLayer); - var centre = new OpenLayers.LonLat(%s, %s); var zoom = 11; - map.setCenter(centre, zoom); updateLocation(); + var osm = new OpenLayers.Layer.OSM("OpenStreetMap"); var markers = new OpenLayers.Layer.Markers("Markers"); - map.addLayer(markers); - markers.addMarker(new OpenLayers.Marker(centre)); + map.addLayers([osm, markers]); + setMapLayers("M"); - map.events.register("moveend", map, updateLocation); - map.events.register("changelayer", map, updateLocation); + // add a layer switcher + map.addControl(new OpenLayers.Control.LayerSwitcher()); + + map.zoomToMaxExtent(); - handleResize(); }""" # NarrativeWeb javascript code for PlacePage's "Google Maps"...