Change the OSM example to show how to setCenter (using reprojection), in

part to demonstrate that OSM is in spherical mercator coords.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@10583 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2010-08-04 18:41:00 +00:00
parent f0736370f3
commit c77688a0be

View File

@@ -10,7 +10,12 @@
map = new OpenLayers.Map( 'map');
layer = new OpenLayers.Layer.OSM( "Simple OSM Map");
map.addLayer(layer);
map.zoomToMaxExtent();
map.setCenter(
new OpenLayers.LonLat(-71.147, 42.472).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
), 12
);
}
</script>
</head>