Fixing ArcGISCache layer

This is done by caching the tileOrigin at grid creation time.
This commit is contained in:
ahocevar
2012-10-11 22:26:59 +02:00
parent c5bb52d93f
commit e7292ecbe2

View File

@@ -358,6 +358,17 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
return OpenLayers.Layer.XYZ.prototype.clone.apply(this, [obj]);
},
/**
* Method: initGriddedTiles
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
*/
initGriddedTiles: function(bounds) {
delete this._tileOrigin;
OpenLayers.Layer.XYZ.prototype.initGriddedTiles.apply(this, arguments);
},
/**
* Method: getMaxExtent
* Get this layer's maximum extent.
@@ -379,8 +390,11 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
* {<OpenLayers.LonLat>} The tile origin.
*/
getTileOrigin: function() {
var extent = this.getMaxExtent();
return new OpenLayers.LonLat(extent.left, extent.bottom);
if (!this._tileOrigin) {
var extent = this.getMaxExtent();
this._tileOrigin = new OpenLayers.LonLat(extent.left, extent.bottom);
}
return this._tileOrigin;
},
/**