Created
July 25, 2012 19:15
-
-
Save eknuth/3177975 to your computer and use it in GitHub Desktop.
Using ESRI's Ocean Basemap with OpenLayers
This file contains hidden or 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
var map = new OpenLayers.Map('map_container', { | |
allOverlays: true, | |
displayProjection: new OpenLayers.Projection("EPSG:4326")}), | |
esriOcean = new OpenLayers.Layer.XYZ("ESRI Ocean Basemap", | |
"http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/${z}/${y}/${x}", | |
{ | |
sphericalMercator: true, | |
isBaseLayer: true, | |
numZoomLevels: 13 | |
} | |
); | |
map.addLayers([esriOcean]); | |
map.setCenter(new OpenLayers.LonLat(-74, 38).transform( | |
new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")), 7); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment