try to add OpenLayers.js support for OpenStreetMap
svn: r17952
This commit is contained in:
parent
5a6ddb8b60
commit
17a863b4cc
@ -129,17 +129,22 @@ openstreet_jsc = """
|
|||||||
function mapInit(){
|
function mapInit(){
|
||||||
map = createMap("map");
|
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.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
|
||||||
map.addLayer(map.dataLayer);
|
map.addLayer(map.dataLayer);
|
||||||
|
|
||||||
var centre = new OpenLayers.LonLat(%s, %s);
|
var centre = new OpenLayers.LonLat(%s, %s);
|
||||||
var zoom = 11;
|
var zoom = 11;
|
||||||
|
|
||||||
setMapCenter(centre, zoom);
|
setMapCenter(centre, zoom);
|
||||||
|
|
||||||
updateLocation();
|
updateLocation();
|
||||||
|
|
||||||
|
var markers = new OpenLayers.Layer.Markers("Markers");
|
||||||
|
map.addLayer(markers);
|
||||||
|
|
||||||
|
markers.addMarker(new OpenLayers.Marker(centre));
|
||||||
|
|
||||||
setMapLayers("M");
|
setMapLayers("M");
|
||||||
|
|
||||||
map.events.register("moveend", map, updateLocation);
|
map.events.register("moveend", map, updateLocation);
|
||||||
|
Loading…
Reference in New Issue
Block a user