git-svn-id: http://svn.openlayers.org/trunk/openlayers@10650 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
var map, layer;
|
|
|
|
// if tiles are not available, hide images
|
|
//OpenLayers.Util.onImageLoadError = function() {
|
|
// this.style.display = "none";
|
|
//}
|
|
|
|
// called on body load
|
|
function init() {
|
|
|
|
var extent = new OpenLayers.Bounds(
|
|
-13758743.4295939, 5591455.28887228, -13531302.3472101 , 5757360.4178881
|
|
);
|
|
|
|
map = new OpenLayers.Map({
|
|
div: "map",
|
|
maxExtent: new OpenLayers.Bounds(
|
|
-128 * 156543.0339, -128 * 156543.0339,
|
|
128 * 156543.0339, 128 * 156543.0339
|
|
),
|
|
restrictedExtent: extent,
|
|
maxResolution: 611.496226171875, // corresponds to level 8 in the cache
|
|
numZoomLevels: 6,
|
|
projection: new OpenLayers.Projection("EPSG:900913"),
|
|
units: "m",
|
|
layers: [
|
|
new OpenLayers.Layer.XYZ(
|
|
"ESRI",
|
|
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer/tile/${z}/${y}/${x}",
|
|
{zoomOffset: 8} // since our map maxResolution differs from cache max resolution
|
|
)
|
|
]
|
|
});
|
|
|
|
map.zoomToExtent(extent);
|
|
|
|
}
|