[OpenLayers-Commits] r2076 - in sandbox/vector: examples lib/OpenLayers/Layer

commits at openlayers.org commits at openlayers.org
Sun Dec 17 08:07:38 EST 2006


Author: crschmidt
Date: 2006-12-17 08:07:32 -0500 (Sun, 17 Dec 2006)
New Revision: 2076

Modified:
   sandbox/vector/examples/wfs-T.html
   sandbox/vector/lib/OpenLayers/Layer/Vector.js
Log:
Trying to improve performance in WFS-T demo. 


Modified: sandbox/vector/examples/wfs-T.html
===================================================================
--- sandbox/vector/examples/wfs-T.html	2006-12-16 15:47:37 UTC (rev 2075)
+++ sandbox/vector/examples/wfs-T.html	2006-12-17 13:07:32 UTC (rev 2076)
@@ -38,7 +38,7 @@
             line = new OpenLayers.Layer.WFS("Line",
                 "/geoserver/wfs",
                 {typename: "line", geometry_column: 'the_geom', maxZoomLevel : 4},
-                {featureClass: OpenLayers.Feature.WFS, style: new OpenLayers.Style({strokeColor: "red"})});
+                {featureClass: OpenLayers.Feature.WFS, style: new OpenLayers.Style({strokeColor: "red"}), 'redrawWhileMoving': false});
             map.addLayer(line);
             if (!map.getCenter()) {
             map.setCenter(new OpenLayers.LonLat(0, 45), 6);

Modified: sandbox/vector/lib/OpenLayers/Layer/Vector.js
===================================================================
--- sandbox/vector/lib/OpenLayers/Layer/Vector.js	2006-12-16 15:47:37 UTC (rev 2075)
+++ sandbox/vector/lib/OpenLayers/Layer/Vector.js	2006-12-17 13:07:32 UTC (rev 2076)
@@ -16,6 +16,8 @@
 
     /** @type Boolean */
     isFixed: true,
+
+    redrawWhileMoving: true,
 	
     /** @type Boolean */
 	isVector: true,
@@ -140,11 +142,13 @@
     },
 
     moveTo:function(bounds, zoomChanged, minor) {
-        OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
-        this.renderer.createRoot(this.div);
-        this.renderer.setSize(this.map.getSize().w, this.map.getSize().h);
-        this.renderer.setExtent(this.map.getExtent().left, this.map.getExtent().top, 
+        if (!minor && !this.redrawWhileMoving) {
+            OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
+            this.renderer.createRoot(this.div);
+            this.renderer.setSize(this.map.getSize().w, this.map.getSize().h);
+            this.renderer.setExtent(this.map.getExtent().left, this.map.getExtent().top, 
                                 this.map.getExtent().getWidth(), this.map.getExtent().getHeight());
+        }   
     },
     
     



More information about the Commits mailing list