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]);
|
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
|
* Method: getMaxExtent
|
||||||
* Get this layer's maximum extent.
|
* Get this layer's maximum extent.
|
||||||
@@ -379,8 +390,11 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
|||||||
* {<OpenLayers.LonLat>} The tile origin.
|
* {<OpenLayers.LonLat>} The tile origin.
|
||||||
*/
|
*/
|
||||||
getTileOrigin: function() {
|
getTileOrigin: function() {
|
||||||
var extent = this.getMaxExtent();
|
if (!this._tileOrigin) {
|
||||||
return new OpenLayers.LonLat(extent.left, extent.bottom);
|
var extent = this.getMaxExtent();
|
||||||
|
this._tileOrigin = new OpenLayers.LonLat(extent.left, extent.bottom);
|
||||||
|
}
|
||||||
|
return this._tileOrigin;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user