[OpenLayers-Commits] r12425 - in sandbox/camptocamp/clientzoom: lib/OpenLayers/Layer tests/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Sep 29 11:10:09 EDT 2011


Author: erilem
Date: 2011-09-29 08:10:08 -0700 (Thu, 29 Sep 2011)
New Revision: 12425

Modified:
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js
   sandbox/camptocamp/clientzoom/tests/Layer/Grid.html
Log:
function getServerSupportedZoom renamed to getServerZoom

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-09-29 14:40:31 UTC (rev 12424)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/Grid.js	2011-09-29 15:10:08 UTC (rev 12425)
@@ -321,14 +321,14 @@
     },
 
     /**
-     * Method: getServerSupportedZoom
+     * Method: getServerZoom
      * Return the zoom value corresponding to the best zoom supported by the server
      * resolution.
      *
      * Returns:
      * {Number} The closest server supported zoom.
      */
-    getServerSupportedZoom: function() {
+    getServerZoom: function() {
         return this.map.getZoomForResolution(this.getServerResolution());
     },
 

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js	2011-09-29 14:40:31 UTC (rev 12424)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/TMS.js	2011-09-29 15:10:08 UTC (rev 12425)
@@ -176,7 +176,7 @@
         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.getServerSupportedZoom() + this.zoomOffset;
+            this.getServerZoom() + 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/WMTS.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js	2011-09-29 14:40:31 UTC (rev 12424)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/WMTS.js	2011-09-29 15:10:08 UTC (rev 12425)
@@ -333,7 +333,7 @@
         return this.serverResolutions != null ?
             OpenLayers.Util.indexOf(this.serverResolutions,
                                     this.getServerResolution()) :
-            this.getServerSupportedZoom() + this.zoomOffset;
+            this.getServerZoom() + this.zoomOffset;
     },
     
     /**

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js	2011-09-29 14:40:31 UTC (rev 12424)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/XYZ.js	2011-09-29 15:10:08 UTC (rev 12425)
@@ -156,7 +156,7 @@
         var resolutions = this.serverResolutions || this.resolutions;
         var z = this.zoomOffset == 0 ?
             OpenLayers.Util.indexOf(resolutions, res) :
-            this.getServerSupportedZoom() + this.zoomOffset;
+            this.getServerZoom() + this.zoomOffset;
 
         var limit = Math.pow(2, z);
         if (this.wrapDateLine)

Modified: sandbox/camptocamp/clientzoom/tests/Layer/Grid.html
===================================================================
--- sandbox/camptocamp/clientzoom/tests/Layer/Grid.html	2011-09-29 14:40:31 UTC (rev 12424)
+++ sandbox/camptocamp/clientzoom/tests/Layer/Grid.html	2011-09-29 15:10:08 UTC (rev 12425)
@@ -652,7 +652,7 @@
         t.ok(exc != undefined, '[4] getServerResolution generates exception');
     }
 
-    function test_getServerSupportedZoom(t) {
+    function test_getServerZoom(t) {
 
         t.plan(5);
 
@@ -667,32 +667,32 @@
         map.addLayer(layer);
 
         resolution = 8;
-        zoom = layer.getServerSupportedZoom();
-        t.eq(zoom, 0, '[1] getServerSupportedZoom return value is correct');
+        zoom = layer.getServerZoom();
+        t.eq(zoom, 0, '[1] getServerZoom return value is correct');
 
         resolution = 4;
-        zoom = layer.getServerSupportedZoom();
-        t.eq(zoom, 1, '[2] getServerSupportedZoom return value is correct');
+        zoom = layer.getServerZoom();
+        t.eq(zoom, 1, '[2] getServerZoom return value is correct');
 
         layer.serverResolutions = [2, 1];
         resolution = 1;
-        zoom = layer.getServerSupportedZoom();
-        t.eq(zoom, 3, '[3] getServerSupportedZoom return value is correct');
+        zoom = layer.getServerZoom();
+        t.eq(zoom, 3, '[3] getServerZoom return value is correct');
 
         layer.serverResolutions = [2];
         resolution = 0.5;
-        zoom = layer.getServerSupportedZoom();
-        t.eq(zoom, 2, '[4] getServerSupportedZoom return value is correct');
+        zoom = layer.getServerZoom();
+        t.eq(zoom, 2, '[4] getServerZoom return value is correct');
 
         var exc;
         layer.serverResolutions = [0.5];
         resolution = 1;
         try {
-            zoom = layer.getServerSupportedZoom();
+            zoom = layer.getServerZoom();
         } catch(e) {
             exc = e;
         }
-        t.ok(exc != undefined, '[4] getServerSupportedZoom generates exception');
+        t.ok(exc != undefined, '[4] getServerZoom generates exception');
 
         map.destroy();
     }



More information about the Commits mailing list