6148: OSM layer for OpenStreetMap

svn: r20605
This commit is contained in:
Jérôme Rapinat 2012-10-26 09:31:20 +00:00
parent 2d0b93cc3f
commit ce5adbebe9

View File

@ -260,19 +260,26 @@ openstreetmap_jsc = """
function initialize(){
var map = new OpenLayers.Map('place_canvas');
var wms = new OpenLayers.Layer.WMS(
"OpenLayers WMS",
"http://vmap0.tiles.osgeo.org/wms/vmap0",
{'layers':'basic'});
map.addLayer(wms);
var osm = new OpenLayers.Layer.OSM()
map.addLayer(osm);
map.setCenter(new OpenLayers.LonLat(0, 0), 1);
var lonLat = new OpenLayers.LonLat(%s, %s)
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
);
var zoom =16;
map.setCenter(lonLat, zoom);
var markers = new OpenLayers.Layer.Markers("Markers");
markers.addMarker(new OpenLayers.Marker(lonLat));
map.addLayer(markers);
marker = new OpenLayers.Marker(new OpenLayers.LonLat(%s, %s));
markers.addMarker(marker);
// add overview control
map.addControl(new OpenLayers.Control.OverviewMap());
// add a layer switcher
map.addControl(new OpenLayers.Control.LayerSwitcher());
}"""