Fixing ArcGISCache layer
This is done by caching the tileOrigin at grid creation time.
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user