[OpenLayers-Commits] r12294 - sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Aug 31 05:01:59 EDT 2011


Author: cmoullet
Date: 2011-08-31 02:01:58 -0700 (Wed, 31 Aug 2011)
New Revision: 12294

Modified:
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TileCache.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js
Log:
Rename to getServerSupportedResolution and getServerSupportedZoom


Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-08-31 08:44:33 UTC (rev 12293)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-08-31 09:01:58 UTC (rev 12294)
@@ -238,8 +238,8 @@
             var forceReTile = !this.grid.length || zoomChanged;
 
             var resolution = this.map.getResolution(),
-                availableResolution = this.getAvailableResolution();
-            if (resolution !== availableResolution) {
+                serverSupportedResolution = this.getServerSupportedResolution();
+            if (resolution !== serverSupportedResolution) {
                 bounds = this.map.calculateBounds(null, availableResolution);
             }
 
@@ -294,7 +294,7 @@
     },
 
     /**
-     * Method: getAvailableResolution
+     * Method: getServerSupportedResolution
      * Return the server-supported resolution that is the closest to
      *     the resolution passed as a parameter. If no resolution is
      *     passed the map resolution is used.
@@ -305,7 +305,7 @@
      * Returns:
      * {Number} The closest available resolution.
      */
-    getAvailableResolution: function(resolution) {
+    getServerSupportedResolution: function(resolution) {
         resolution = resolution || this.map.getResolution();
         if(this.serverResolutions &&
            OpenLayers.Util.indexOf(this.serverResolutions, resolution) === -1) {
@@ -325,15 +325,15 @@
     },
 
     /**
-     * Method: getAvailableZoom
-     * Return the zoom value corresponding to the closest available
+     * Method: getServerSupportedZoom
+     * Return the zoom value corresponding to the best zoom supported by the server
      * resolution.
      *
      * Returns:
      * {Number} The available zoom.
      */
-    getAvailableZoom: function() {
-        return this.map.getZoomForResolution(this.getAvailableResolution());
+    getServerSupportedZoom: function() {
+        return this.map.getZoomForResolution(this.getServerSupportedResolution());
     },
 
     /**
@@ -583,7 +583,7 @@
                       Math.max(1, 2 * this.buffer);
         
         var origin = this.getTileOrigin();
-        var resolution = this.getAvailableResolution();
+        var resolution = this.getServerSupportedResolution();
         
         var tileLayout = this.calculateGridLayout(bounds, origin, resolution);
 
@@ -858,7 +858,7 @@
         var grid = this.grid;
         var modelRow = grid[modelRowIndex];
 
-        var resolution = this.getAvailableResolution();
+        var resolution = this.getServerSupportedResolution();
         var deltaY = (prepend) ? -this.tileSize.h : this.tileSize.h;
         var deltaLat = resolution * -deltaY;
 
@@ -891,7 +891,7 @@
      */
     shiftColumn: function(prepend) {
         var deltaX = (prepend) ? -this.tileSize.w : this.tileSize.w;
-        var resolution = this.getAvailableResolution();
+        var resolution = this.getServerSupportedResolution();
         var deltaLon = resolution * deltaX;
 
         for (var i=0, len=this.grid.length; i<len; i++) {

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js	2011-08-31 08:44:33 UTC (rev 12293)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js	2011-08-31 09:01:58 UTC (rev 12294)
@@ -180,12 +180,12 @@
      */
     getURL: function (bounds) {
         bounds = this.adjustBounds(bounds);
-        var res = this.getAvailableResolution();
+        var res = this.getServerSupportedResolution();
         var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
         var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
         var z = this.serverResolutions != null ?
             OpenLayers.Util.indexOf(this.serverResolutions, res) :
-            this.getAvailableZoom() + this.zoomOffset;
+            this.getServerSupportedZoom() + this.zoomOffset;
         var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type; 
         var url = this.url;
         if (OpenLayers.Util.isArray(url)) {

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TileCache.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TileCache.js	2011-08-31 08:44:33 UTC (rev 12293)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TileCache.js	2011-08-31 09:01:58 UTC (rev 12294)
@@ -109,7 +109,7 @@
      *     passed-in bounds and appropriate tile size specified as parameters.
      */
     getURL: function(bounds) {
-        var res = this.getAvailableResolution();
+        var res = this.getServerSupportedResolution();
         var bbox = this.maxExtent;
         var size = this.tileSize;
         var tileX = Math.round((bounds.left - bbox.left) / (res * size.w));

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js	2011-08-31 08:44:33 UTC (rev 12293)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js	2011-08-31 09:01:58 UTC (rev 12294)
@@ -327,7 +327,7 @@
     getMatrix: function() {
         var matrix, zoom;
         if (!this.matrixIds || this.matrixIds.length === 0) {
-            zoom = this.getAvailableZoom();
+            zoom = this.getServerSupportedZoom();
             matrix = {identifier: zoom + this.zoomOffset};
         } else {
             // get appropriate matrix given the map scale if possible
@@ -336,7 +336,7 @@
                 var denom = 
                     OpenLayers.METERS_PER_INCH * 
                     OpenLayers.INCHES_PER_UNIT[this.units] * 
-                    this.getAvailableResolution() / 0.28E-3;
+                    this.getServerSupportedResolution() / 0.28E-3;
                 var diff = Number.POSITIVE_INFINITY;
                 var delta;
                 for (var i=0, ii=this.matrixIds.length; i<ii; ++i) {
@@ -348,7 +348,7 @@
                 }
             } else {
                 // fall back on zoom as index
-                zoom = this.getAvailableZoom();
+                zoom = this.getServerSupportedZoom();
                 matrix = this.matrixIds[zoom + this.zoomOffset];
             }
         }
@@ -369,7 +369,7 @@
      *     (respectively) of the given location within the target tile.
      */
     getTileInfo: function(loc) {
-        var res = this.getAvailableResolution();
+        var res = this.getServerSupportedResolution();
         
         var fx = (loc.lon - this.tileOrigin.lon) / (res * this.tileSize.w);
         var fy = (this.tileOrigin.lat - loc.lat) / (res * this.tileSize.h);

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js	2011-08-31 08:44:33 UTC (rev 12293)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js	2011-08-31 09:01:58 UTC (rev 12294)
@@ -148,14 +148,14 @@
      * {Object} - an object with x, y and z properties.
      */
     getXYZ: function(bounds) {
-        var res = this.getAvailableResolution();
+        var res = this.getServerSupportedResolution();
         var x = Math.round((bounds.left - this.maxExtent.left) /
             (res * this.tileSize.w));
         var y = Math.round((this.maxExtent.top - bounds.top) /
             (res * this.tileSize.h));
         var z = this.serverResolutions != null ?
             OpenLayers.Util.indexOf(this.serverResolutions, res) :
-            this.getAvailableZoom() + this.zoomOffset;
+            this.getServerSupportedZoom() + this.zoomOffset;
 
         var limit = Math.pow(2, z);
         if (this.wrapDateLine)



More information about the Commits mailing list