Skip to content

Instantly share code, notes, and snippets.

@shaunakv1
Created January 16, 2013 17:36
Show Gist options
  • Save shaunakv1/4549044 to your computer and use it in GitHub Desktop.
Save shaunakv1/4549044 to your computer and use it in GitHub Desktop.
JavaScript: Openlayers Map Starting Template
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