Use ol instead of OpenLayers.
This commit is contained in:
parent
bbeda839e6
commit
7100d9df1b
|
@ -130,17 +130,17 @@
|
||||||
var lon = 12.5618443;
|
var lon = 12.5618443;
|
||||||
var zoom = 18;
|
var zoom = 18;
|
||||||
|
|
||||||
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
|
var fromProjection = new ol.Projection("EPSG:4326"); // Transform from WGS 1984
|
||||||
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
|
var toProjection = new ol.Projection("EPSG:900913"); // to Spherical Mercator Projection
|
||||||
var position = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection);
|
var position = new ol.LonLat(lon, lat).transform( fromProjection, toProjection);
|
||||||
|
|
||||||
map = new OpenLayers.Map("Map");
|
map = new ol.Map("Map");
|
||||||
var mapnik = new OpenLayers.Layer.OSM();
|
var mapnik = new ol.Layer.OSM();
|
||||||
map.addLayer(mapnik);
|
map.addLayer(mapnik);
|
||||||
|
|
||||||
var markers = new OpenLayers.Layer.Markers( "Markers" );
|
var markers = new ol.Layer.Markers( "Markers" );
|
||||||
map.addLayer(markers);
|
map.addLayer(markers);
|
||||||
markers.addMarker(new OpenLayers.Marker(position));
|
markers.addMarker(new ol.Marker(position));
|
||||||
|
|
||||||
map.setCenter(position, zoom);
|
map.setCenter(position, zoom);
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue