Use ol instead of OpenLayers.

This commit is contained in:
Vidir Valberg Gudmundsson 2017-09-24 23:52:20 +02:00
parent bbeda839e6
commit 7100d9df1b

View file

@ -130,17 +130,17 @@
var lon = 12.5618443;
var zoom = 18;
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
var position = new OpenLayers.LonLat(lon, lat).transform( fromProjection, toProjection);
var fromProjection = new ol.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new ol.Projection("EPSG:900913"); // to Spherical Mercator Projection
var position = new ol.LonLat(lon, lat).transform( fromProjection, toProjection);
map = new OpenLayers.Map("Map");
var mapnik = new OpenLayers.Layer.OSM();
map = new ol.Map("Map");
var mapnik = new ol.Layer.OSM();
map.addLayer(mapnik);
var markers = new OpenLayers.Layer.Markers( "Markers" );
var markers = new ol.Layer.Markers( "Markers" );
map.addLayer(markers);
markers.addMarker(new OpenLayers.Marker(position));
markers.addMarker(new ol.Marker(position));
map.setCenter(position, zoom);
</script>