[OpenLayers-Commits] r12282 -
sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Mon Aug 29 04:37:59 EDT 2011
Author: erilem
Date: 2011-08-29 01:37:58 -0700 (Mon, 29 Aug 2011)
New Revision: 12282
Modified:
sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js
Log:
make Layer.WMTS rely on getAvailableResolution and getAvailableZoom
Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js 2011-08-29 08:37:46 UTC (rev 12281)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js 2011-08-29 08:37:58 UTC (rev 12282)
@@ -314,9 +314,10 @@
* Get the appropriate matrix definition for the current map resolution.
*/
getMatrix: function() {
- var matrix;
+ var matrix, zoom;
if (!this.matrixIds || this.matrixIds.length === 0) {
- matrix = {identifier: this.map.getZoom() + this.zoomOffset};
+ zoom = this.getAvailableZoom();
+ matrix = {identifier: zoom + this.zoomOffset};
} else {
// get appropriate matrix given the map scale if possible
if ("scaleDenominator" in this.matrixIds[0]) {
@@ -324,7 +325,7 @@
var denom =
OpenLayers.METERS_PER_INCH *
OpenLayers.INCHES_PER_UNIT[this.units] *
- this.map.getResolution() / 0.28E-3;
+ this.getAvailableResolution() / 0.28E-3;
var diff = Number.POSITIVE_INFINITY;
var delta;
for (var i=0, ii=this.matrixIds.length; i<ii; ++i) {
@@ -336,7 +337,8 @@
}
} else {
// fall back on zoom as index
- matrix = this.matrixIds[this.map.getZoom() + this.zoomOffset];
+ zoom = this.getAvailableZoom();
+ matrix = this.matrixIds[zoom + this.zoomOffset];
}
}
return matrix;
@@ -356,7 +358,7 @@
* (respectively) of the given location within the target tile.
*/
getTileInfo: function(loc) {
- var res = this.map.getResolution();
+ var res = this.getAvailableResolution();
var fx = (loc.lon - this.tileOrigin.lon) / (res * this.tileSize.w);
var fy = (this.tileOrigin.lat - loc.lat) / (res * this.tileSize.h);
More information about the Commits
mailing list