From 569c9f790d3c1bf645f4d2300e756ef8c1806677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 24 Jul 2011 13:25:47 +0000 Subject: [PATCH] try to add support for OpenStreetMap's marker and layer svn: r17953 --- src/plugins/lib/libhtmlconst.py | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/plugins/lib/libhtmlconst.py b/src/plugins/lib/libhtmlconst.py index 82f1d5986..878c84a23 100644 --- a/src/plugins/lib/libhtmlconst.py +++ b/src/plugins/lib/libhtmlconst.py @@ -121,36 +121,36 @@ _COPY_OPTIONS = [ # NarrativeWeb javascript code for PlacePage's "Open Street Map"... openstreet_jsc = """ - var marker; - var map; + var marker; + var map; - OpenLayers.Lang.setCode("%s"); + OpenLayers.Lang.setCode("%s"); - function mapInit(){ - map = createMap("map"); + function init(){ + map = new OpenLayers.Map("map_canvas"); - map.dataLayer = new OpenLayers.OSM(document.getElementById("map_canvas"), { "visibility": true }); - map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData); - map.addLayer(map.dataLayer); + 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; + var centre = new OpenLayers.LonLat(%s, %s); + var zoom = 11; - setMapCenter(centre, zoom); + map.setCenter(centre, zoom); - updateLocation(); + updateLocation(); - var markers = new OpenLayers.Layer.Markers("Markers"); - map.addLayer(markers); + var markers = new OpenLayers.Layer.Markers("Markers"); + map.addLayer(markers); - markers.addMarker(new OpenLayers.Marker(centre)); + markers.addMarker(new OpenLayers.Marker(centre)); - setMapLayers("M"); + setMapLayers("M"); - map.events.register("moveend", map, updateLocation); - map.events.register("changelayer", map, updateLocation); + map.events.register("moveend", map, updateLocation); + map.events.register("changelayer", map, updateLocation); - handleResize(); + handleResize(); }""" # NarrativeWeb javascript code for PlacePage's "Google Maps"...