Skip to content

Instantly share code, notes, and snippets.

@shaunakv1
Created January 24, 2013 17:23
Show Gist options
  • Save shaunakv1/4625384 to your computer and use it in GitHub Desktop.
Save shaunakv1/4625384 to your computer and use it in GitHub Desktop.
JavaScript OpenLayers Map With ESRI Tiles
var slrMap = {
//default properties
map : null,
//class functions
loadMap: function(){
this.map = new OpenLayers.Map({
div: "map",
projection: "EPSG:900913"
});
this.map.addLayer(
new OpenLayers.Layer.XYZ("esri", 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${z}/${y}/${x}', {
transitionEffect: "resize",
sphericalMercator: true,
format: "image/jpg"
}));
this.map.addLayer(
new OpenLayers.Layer.XYZ("noaa", 'http://csc.noaa.gov/arcgis/rest/services/dc_slr/marsh_000/MapServer/tile/${z}/${y}/${x}', {
transitionEffect: "resize",
//sphericalMercator: true,
format: "image/jpg",
isBaseLayer : false,
transparent : "true",
opacity : 0.9
}));
this.map.addControl(new OpenLayers.Control.LayerSwitcher());
this.map.setCenter(new OpenLayers.LonLat(-10670712.603429, 4605008.2646843), 4);
//this._fetchEsriLayerData();
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment