From 17a863b4cc55f4294a5fc03399ebf7167a09503c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Rapinat?= Date: Sun, 24 Jul 2011 12:54:58 +0000 Subject: [PATCH] try to add OpenLayers.js support for OpenStreetMap svn: r17952 --- src/plugins/lib/libhtmlconst.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/lib/libhtmlconst.py b/src/plugins/lib/libhtmlconst.py index 2d7040506..82f1d5986 100644 --- a/src/plugins/lib/libhtmlconst.py +++ b/src/plugins/lib/libhtmlconst.py @@ -129,17 +129,22 @@ openstreet_jsc = """ function mapInit(){ map = createMap("map"); - map.dataLayer = new OpenLayers.Layer("Data", { "visibility": false }); + map.dataLayer = new OpenLayers.OSM(document.getElementById("map_canvas"), { "visibility": true }); 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); + setMapCenter(centre, zoom); updateLocation(); + var markers = new OpenLayers.Layer.Markers("Markers"); + map.addLayer(markers); + + markers.addMarker(new OpenLayers.Marker(centre)); + setMapLayers("M"); map.events.register("moveend", map, updateLocation);