[OpenLayers-Commits] r11731 - in sandbox/cmoullet/openlayers: . examples lib/OpenLayers lib/OpenLayers/Handler tests tests/manual

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Mar 29 04:14:48 EDT 2011


Author: cmoullet
Date: 2011-03-29 01:14:47 -0700 (Tue, 29 Mar 2011)
New Revision: 11731

Modified:
   sandbox/cmoullet/openlayers/
   sandbox/cmoullet/openlayers/examples/arcgiscache_ags.html
   sandbox/cmoullet/openlayers/lib/OpenLayers/Events.js
   sandbox/cmoullet/openlayers/lib/OpenLayers/Handler/Box.js
   sandbox/cmoullet/openlayers/tests/Map.html
   sandbox/cmoullet/openlayers/tests/manual/vector-features-performance.html
Log:
merge with trunk


Property changes on: sandbox/cmoullet/openlayers
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11161-11688,11690-11722
   + /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11161-11688,11690-11730

Modified: sandbox/cmoullet/openlayers/examples/arcgiscache_ags.html
===================================================================
--- sandbox/cmoullet/openlayers/examples/arcgiscache_ags.html	2011-03-28 13:52:59 UTC (rev 11730)
+++ sandbox/cmoullet/openlayers/examples/arcgiscache_ags.html	2011-03-29 08:14:47 UTC (rev 11731)
@@ -141,7 +141,7 @@
                         tileSize: new OpenLayers.Size(layerInfo.tileInfo.cols, layerInfo.tileInfo.rows),                        
                         tileOrigin: new OpenLayers.LonLat(layerInfo.tileInfo.origin.x , layerInfo.tileInfo.origin.y),                        
                         maxExtent: layerMaxExtent,                        
-                        projection: 'EPSG:' + layerInfo.spatialReference.wkid,
+                        projection: 'EPSG:' + layerInfo.spatialReference.wkid
                     });
 
             

Modified: sandbox/cmoullet/openlayers/lib/OpenLayers/Events.js
===================================================================
--- sandbox/cmoullet/openlayers/lib/OpenLayers/Events.js	2011-03-28 13:52:59 UTC (rev 11730)
+++ sandbox/cmoullet/openlayers/lib/OpenLayers/Events.js	2011-03-29 08:14:47 UTC (rev 11731)
@@ -860,10 +860,9 @@
         // returns incorrect offsets. So our best bet is to not invalidate the
         // offsets once we have them, and hope that the page was not scrolled
         // when we did the initial calculation.
-        if (!((document.body.scrollTop != 0 ||
-                                document.body.scrollLeft != 0) &&
-                                navigator.userAgent.match(/iPhone/i))) {
-            OpenLayers.Console.log("clear");
+        var body = document.body;
+        if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) &&
+                                    navigator.userAgent.match(/iPhone/i))) {
             this.element.offsets = null;
         }
     },      

Modified: sandbox/cmoullet/openlayers/lib/OpenLayers/Handler/Box.js
===================================================================
--- sandbox/cmoullet/openlayers/lib/OpenLayers/Handler/Box.js	2011-03-28 13:52:59 UTC (rev 11730)
+++ sandbox/cmoullet/openlayers/lib/OpenLayers/Handler/Box.js	2011-03-29 08:14:47 UTC (rev 11731)
@@ -183,7 +183,11 @@
      */
     deactivate: function () {
         if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
-            this.dragHandler.deactivate();
+            if (this.dragHandler.deactivate()) {
+                if (this.zoomBox) {
+                    this.removeBox();
+                }
+            }
             return true;
         } else {
             return false;

Modified: sandbox/cmoullet/openlayers/tests/Map.html
===================================================================
--- sandbox/cmoullet/openlayers/tests/Map.html	2011-03-28 13:52:59 UTC (rev 11730)
+++ sandbox/cmoullet/openlayers/tests/Map.html	2011-03-29 08:14:47 UTC (rev 11731)
@@ -1593,9 +1593,21 @@
         
     }
 
+    // test if we can call updateSize before document.body is ready. updateOk
+    // is tested in the test_updateSize function below
+    var earlyMap = new OpenLayers.Map();
+    var updateOk;
+    try {
+      earlyMap.updateSize();
+      updateOk = true;
+    } catch(e) {}
+    earlyMap.destroy();
     function test_updateSize(t) {
-        t.plan(2);
+        t.plan(3);
 
+        // checking updateSize from outside this test function (see above)
+        t.ok(updateOk, "updateSize works before document.body is ready");
+
         var map, moveToCnt, size;
 
         map = new OpenLayers.Map({div: "map"});
@@ -1625,7 +1637,7 @@
         map.updateSize();
         t.eq(moveToCnt, 1, "updateSize move the map if it has a center");
 
-        map.destroy();
+        map.destroy();        
     }
     
     function test_invisible_map(t) {

Modified: sandbox/cmoullet/openlayers/tests/manual/vector-features-performance.html
===================================================================
--- sandbox/cmoullet/openlayers/tests/manual/vector-features-performance.html	2011-03-28 13:52:59 UTC (rev 11730)
+++ sandbox/cmoullet/openlayers/tests/manual/vector-features-performance.html	2011-03-29 08:14:47 UTC (rev 11731)
@@ -81,9 +81,16 @@
         }
 
         function init(){
+            // allow testing of specific renderers via "?renderer=Canvas", etc
+            var renderer = OpenLayers.Util.getParameters(window.location.href).renderer;
+            renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers;
+
             map = new OpenLayers.Map('map');
             
-            vectorLayer = new OpenLayers.Layer.Vector("Vector Layer", {isBaseLayer: true});
+            vectorLayer = new OpenLayers.Layer.Vector("Vector Layer", {
+                isBaseLayer: true,
+                renderers: renderer
+            });
 
             map.addLayers([vectorLayer]);
             map.addControl(new OpenLayers.Control.MousePosition());



More information about the Commits mailing list