Created
March 13, 2016 16:19
-
-
Save SteveClement/ac3cfbaafdb67fc9b3d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><body> | |
<div id="mapdiv"></div> | |
<script src="http://www.openlayers.org/api/OpenLayers.js"></script> | |
<script> | |
map = new OpenLayers.Map("mapdiv"); | |
map.addLayer(new OpenLayers.Layer.OSM()); | |
var lat = 49.6056053 | |
var lon = 6.1004009 | |
var lonLat = new OpenLayers.LonLat( lon ,lat ) | |
.transform( | |
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984 | |
map.getProjectionObject() // to Spherical Mercator Projection | |
); | |
var zoom=16; | |
var markers = new OpenLayers.Layer.Markers( "Markers" ); | |
map.addLayer(markers); | |
markers.addMarker(new OpenLayers.Marker(lonLat)); | |
map.setCenter (lonLat, zoom); | |
</script> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment