Created
January 16, 2013 17:36
-
-
Save shaunakv1/4549044 to your computer and use it in GitHub Desktop.
JavaScript: Openlayers Map Starting Template
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
function loadMap() | |
{ | |
//create map object | |
map = new OpenLayers.Map({ | |
div: "map", | |
projection: "EPSG:900913" | |
}); | |
map.addLayer( | |
new OpenLayers.Layer.XYZ("esri", 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/${z}/${y}/${x}', { | |
transitionEffect: "resize", | |
sphericalMercator: true, | |
format: "image/jpg" | |
})); | |
map.addControl(new OpenLayers.Control.LayerSwitcher()); | |
map.setCenter(new OpenLayers.LonLat(-2054627.3200196, 1291480.0297267), 3); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment