try to add OpenLayers.js support for OpenStreetMap

svn: r17952
This commit is contained in:
Jérôme Rapinat 2011-07-24 12:54:58 +00:00
parent 5a6ddb8b60
commit 17a863b4cc

View File

@ -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);