[OpenLayers-Commits] r12300 - in sandbox/camptocamp/clientzoom: examples lib/OpenLayers/Layer lib/OpenLayers/Protocol lib/OpenLayers/Tile

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Aug 31 07:35:17 EDT 2011


Author: erilem
Date: 2011-08-31 04:35:17 -0700 (Wed, 31 Aug 2011)
New Revision: 12300

Added:
   sandbox/camptocamp/clientzoom/examples/clientzoom.html
   sandbox/camptocamp/clientzoom/examples/clientzoom.js
Modified:
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/ArcGISCache.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Protocol/HTTP.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js
   sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js
Log:
Client Zoom example renamed from zoomclient to clientzoom, plus merge from trunk

Conflicts:
	lib/OpenLayers/Layer/ArcGISCache.js
	lib/OpenLayers/Protocol/HTTP.js
	lib/OpenLayers/Tile/BackBufferable.js
	lib/OpenLayers/Tile/Image.js

Added: sandbox/camptocamp/clientzoom/examples/clientzoom.html
===================================================================
--- sandbox/camptocamp/clientzoom/examples/clientzoom.html	                        (rev 0)
+++ sandbox/camptocamp/clientzoom/examples/clientzoom.html	2011-08-31 11:35:17 UTC (rev 12300)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <meta name="apple-mobile-web-app-capable" content="yes">
+        <title>OpenLayers Client Zoom Example</title>
+        <link rel="stylesheet" href="../theme/default/style.css" type="text/css"/>
+        <link rel="stylesheet" href="style.css" type="text/css">
+        <script src="../lib/Firebug/firebug.js"></script>
+        <script src="../lib/OpenLayers.js"></script>
+        <script src="clientzoom.js"></script>
+        <style>
+            .olControlAttribution {
+                bottom: 5px;
+            }
+        </style>
+    </head>
+    <body onload="init();">
+        <h1 id="title">Client Zoom</h1>
+        <div id="tags">
+            clientzoom
+        </div>         
+        <p id="shortdesc">
+
+            This example demonstrates the <strong>"client zoom"</strong>
+            functionality, where OpenLayers stretches the layer div if the
+            current resolution isn't supported by that layer's tile server.
+
+        </p>
+        
+        <div id="map" class="smallmap"></div>
+
+        <div id="docs">
+
+            <p>
+
+                Ths map is configured with 22 resolutions, while the OSM tile
+                server supports only the first 19 resolutions . When the zoom
+                level is 19, 20 or 22 "client zoom" is applied on the OSM
+                layer, i.e. the OSM layer div is stretched as necessary.  The
+                map's initial zoom is 18. So if you zoom in or out you'll see
+                that "client zoom" is applied.
+
+            </p>
+
+            <p>
+
+            Enabling "client zoom" on a layer is done through the
+            <code>serverResolutions</code> option. See the <a
+                href="clientzoom.js" target="_blank"> clientzoom.js source</a>
+            to see how this is done.
+
+            </p>
+        </div>
+    </body>
+</html>

Added: sandbox/camptocamp/clientzoom/examples/clientzoom.js
===================================================================
--- sandbox/camptocamp/clientzoom/examples/clientzoom.js	                        (rev 0)
+++ sandbox/camptocamp/clientzoom/examples/clientzoom.js	2011-08-31 11:35:17 UTC (rev 12300)
@@ -0,0 +1,22 @@
+var map;
+
+function init() {
+    
+    map = new OpenLayers.Map({
+        div: "map",
+        projection: "EPSG:900913",
+        units: "m",
+        maxExtent: new OpenLayers.Bounds(
+            -20037508.34, -20037508.34, 20037508.34, 20037508.34
+        )
+    });    
+    
+    var osm = new OpenLayers.Layer.OSM(null, null, {
+        resolutions: [156543.03390625, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317017, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135,0.25,0.1,0.05],
+        serverResolutions: [156543.03390625, 78271.516953125, 39135.7584765625, 19567.87923828125, 9783.939619140625, 4891.9698095703125, 2445.9849047851562, 1222.9924523925781, 611.4962261962891, 305.74811309814453, 152.87405654907226, 76.43702827453613, 38.218514137268066, 19.109257068634033, 9.554628534317017, 4.777314267158508, 2.388657133579254, 1.194328566789627, 0.5971642833948135]
+    });
+
+    map.addLayers([osm]);
+    map.addControl(new OpenLayers.Control.LayerSwitcher());
+    map.setCenter(new OpenLayers.LonLat(667393.040812,lat=5668008.8022737), 18);
+}

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/ArcGISCache.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/ArcGISCache.js	2011-08-31 09:55:17 UTC (rev 12299)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Layer/ArcGISCache.js	2011-08-31 11:35:17 UTC (rev 12300)
@@ -1,5 +1,5 @@
 /** 
- * @requires OpenLayers/Layer/XYZ.js 
+ * @requires OpenLayers/Layer/XYZ.js
  */ 
 
 /** 

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Protocol/HTTP.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Protocol/HTTP.js	2011-08-31 09:55:17 UTC (rev 12299)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Protocol/HTTP.js	2011-08-31 11:35:17 UTC (rev 12300)
@@ -141,7 +141,7 @@
      * Optional method to translate an <OpenLayers.Filter> object into an object
      *     that can be serialized as request query string provided.  If a custom
      *     method is not provided, the filter will be serialized using the 
-     *     <OpenLayers.Protocol.simpleFilterSerializer> method.
+     *     <OpenLayers.Format.QueryStringFilter> class.
      *
      * Parameters:
      * filter - {<OpenLayers.Filter>} filter to convert.

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js	2011-08-31 09:55:17 UTC (rev 12299)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/BackBufferable.js	2011-08-31 11:35:17 UTC (rev 12300)
@@ -4,12 +4,12 @@
  * full text of the license. */
 
 
-/*
+/**
  * @requires OpenLayers/Tile.js
  * @requires OpenLayers/Util.js
  */
 
-/*
+/**
  * Class: OpenLayers.Tile.BackBufferable
  * Base class for tiles that can have backbuffers during transitions. Do not
  * create instances of this class.

Modified: sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js
===================================================================
--- sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js	2011-08-31 09:55:17 UTC (rev 12299)
+++ sandbox/camptocamp/clientzoom/lib/OpenLayers/Tile/Image.js	2011-08-31 11:35:17 UTC (rev 12300)
@@ -328,7 +328,6 @@
      */
     createBackBuffer: function() {
         var frame = this.frame.cloneNode(false);
-        OpenLayers.Event.stopObservingElement(this.imgDiv);
         frame.appendChild(this.imgDiv);
         this.imgDiv = null;
         return frame;
@@ -340,6 +339,7 @@
      */
     onImageLoad: function() {
         var img = this.imgDiv;
+        OpenLayers.Event.stopObservingElement(img);
         img.style.display = "";
         this.isLoading = false;
         this.events.triggerEvent("loadend");



More information about the Commits mailing list