Skip to content

Instantly share code, notes, and snippets.

@eknuth
Created July 25, 2012 19:15
Show Gist options
  • Save eknuth/3177975 to your computer and use it in GitHub Desktop.
Save eknuth/3177975 to your computer and use it in GitHub Desktop.
Using ESRI's Ocean Basemap with OpenLayers
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