[OpenLayers-Commits] r11367 - sandbox/jennier/openlayers/lib/OpenLayers/Layer

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Feb 23 13:17:13 EST 2011


Author: jennier
Date: 2011-02-23 10:17:13 -0800 (Wed, 23 Feb 2011)
New Revision: 11367

Modified:
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcGIS93Rest.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcIMS.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMap.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMapCache.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapGuide.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapServer.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/TMS.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/TileCache.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/WMTS.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/WorldWind.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/XYZ.js
   sandbox/jennier/openlayers/lib/OpenLayers/Layer/Zoomify.js
Log:
In order to use the stored tile we need a small modification to the getURL function of the layers that extend Grid.js.  This will call the Grid.js GetURL function that will allow the image to be proxied if needed and will replace the URL with the data URI from the store if the tile has been stored. 

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcGIS93Rest.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcGIS93Rest.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcGIS93Rest.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -172,8 +172,10 @@
                 newParams['LAYERDEFS'] = layerDefStrList.join("");
             }
         }
-        var requestString = this.getFullRequestString(newParams);
-        return requestString;
+        var url = this.getFullRequestString(newParams);
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
     
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcIMS.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcIMS.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/ArcIMS.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -205,7 +205,8 @@
             url = this.getUrlOrImage(arcxml.image.output);
         }
         
-        return url;
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
     
     

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMap.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMap.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMap.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -87,11 +87,14 @@
         var scale = Math.round((this.map.getScale() * 10000)) / 10000;
         var pX = Math.round(bounds.left / mapRes);
         var pY = -Math.round(bounds.top / mapRes);
-        return this.getFullRequestString(
+        var url = this.getFullRequestString(
                       { t: pY, 
                         l: pX,
                         s: scale
                       });
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
 
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMapCache.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMapCache.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/KaMapCache.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -141,7 +141,10 @@
             this.extension
           ];
           
-        return components.join("");
+        url = components.join("");
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
 
     CLASS_NAME: "OpenLayers.Layer.KaMapCache"

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapGuide.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapGuide.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapGuide.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -320,7 +320,10 @@
                     });
           }
        }
-       return url;
+        
+       // Check to see if the Image has been stored locally
+       return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
+       
     },
 
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapServer.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapServer.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/MapServer.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -123,7 +123,8 @@
                       imgxy:    [imageSize.w, imageSize.h]
                       });
         
-        return url;
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
     
     /** 

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/TMS.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/TMS.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/TMS.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -128,7 +128,10 @@
         if (url instanceof Array) {
             url = this.selectUrl(path, url);
         }
-        return url + path;
+        url = url + path;
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
 
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/TileCache.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/TileCache.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/TileCache.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -142,7 +142,10 @@
             url = this.selectUrl(path, url);
         }
         url = (url.charAt(url.length - 1) == '/') ? url : url + '/';
-        return url + path;
+        url = url + path;
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);        
     },
 
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/WMTS.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/WMTS.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/WMTS.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -437,7 +437,9 @@
 
             }
         }
-        return url;    
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);    
     },
     
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/WorldWind.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/WorldWind.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/WorldWind.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -103,17 +103,20 @@
         var deg = this.lzd/Math.pow(2,this.getZoom());
         var x = Math.floor((bounds.left - extent.left)/deg);
         var y = Math.floor((bounds.bottom - extent.bottom)/deg);
+        var url;
         if (this.map.getResolution() <= (this.lzd/512)
             && this.getZoom() <= this.zoomLevels) {
-            return this.getFullRequestString(
+            url = this.getFullRequestString(
               { L: zoom, 
                 X: x,
                 Y: y
               });
         } else {
-            return OpenLayers.Util.getImagesLocation() + "blank.gif";
+            url = OpenLayers.Util.getImagesLocation() + "blank.gif";
         }
-
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
 
     CLASS_NAME: "OpenLayers.Layer.WorldWind"

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/XYZ.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/XYZ.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/XYZ.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -125,7 +125,10 @@
             url = this.selectUrl(s, url);
         }
         
-        return OpenLayers.String.format(url, xyz);
+        url = OpenLayers.String.format(url, xyz);
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
     
     /**

Modified: sandbox/jennier/openlayers/lib/OpenLayers/Layer/Zoomify.js
===================================================================
--- sandbox/jennier/openlayers/lib/OpenLayers/Layer/Zoomify.js	2011-02-23 18:04:13 UTC (rev 11366)
+++ sandbox/jennier/openlayers/lib/OpenLayers/Layer/Zoomify.js	2011-02-23 18:17:13 UTC (rev 11367)
@@ -208,7 +208,10 @@
         if (url instanceof Array) {
             url = this.selectUrl(path, url);
         }
-        return url + path;
+        url = url + path;
+        
+        // Check to see if the Image has been stored locally
+        return OpenLayers.Layer.Grid.prototype.getURL.apply(this, [url]);
     },
 
     /**



More information about the Commits mailing list