[OpenLayers-Commits] r11969 - trunk/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon May 16 03:12:06 EDT 2011


Author: erilem
Date: 2011-05-16 00:12:03 -0700 (Mon, 16 May 2011)
New Revision: 11969

Modified:
   trunk/openlayers/examples/wfs-protocol-transactions.html
   trunk/openlayers/examples/wfs-protocol-transactions.js
   trunk/openlayers/examples/wfs-snap-split.html
Log:
Allow to pan the map while drawing in some examples, p=jorix, r=me (closes #3271)

Modified: trunk/openlayers/examples/wfs-protocol-transactions.html
===================================================================
--- trunk/openlayers/examples/wfs-protocol-transactions.html	2011-05-13 22:03:55 UTC (rev 11968)
+++ trunk/openlayers/examples/wfs-protocol-transactions.html	2011-05-16 07:12:03 UTC (rev 11969)
@@ -85,10 +85,13 @@
             <p>
                 Use the tools to create, modify, and delete (in order from left
                 to right) features. Use the save tool (picture of a disk) to
-                save your changes. Use the navigation tool (hand) to stop
-                editing and use the mouse for map navigation.
+                save your changes.
             </p>
             <p>
+                To deactivate "drawing" or "modifying" depress the
+                corresponding button.
+            </p>
+            <p>
                 See the <a href="wfs-protocol-transactions.js" target="_blank">
                 wfs-protocol-transactions.js source</a> to see how this is done.
             </p>        

Modified: trunk/openlayers/examples/wfs-protocol-transactions.js
===================================================================
--- trunk/openlayers/examples/wfs-protocol-transactions.js	2011-05-13 22:03:55 UTC (rev 11968)
+++ trunk/openlayers/examples/wfs-protocol-transactions.js	2011-05-16 07:12:03 UTC (rev 11969)
@@ -43,7 +43,8 @@
         maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508),
         restrictedExtent: extent,
         controls: [
-            new OpenLayers.Control.PanZoom()
+            new OpenLayers.Control.PanZoom(),
+            new OpenLayers.Control.Navigation()
         ]
     });
     var gphy = new OpenLayers.Layer.Google(
@@ -69,12 +70,9 @@
    
     map.addLayers([gphy, wfs]);
 
-    var panel = new OpenLayers.Control.Panel(
-        {'displayClass': 'customEditingToolbar'}
-    );
-    
-    var navigate = new OpenLayers.Control.Navigation({
-        title: "Pan Map"
+    var panel = new OpenLayers.Control.Panel({
+        displayClass: 'customEditingToolbar',
+        allowDepress: true
     });
     
     var draw = new OpenLayers.Control.DrawFeature(
@@ -104,8 +102,7 @@
         displayClass: "olControlSaveFeatures"
     });
 
-    panel.addControls([navigate, save, del, edit, draw]);
-    panel.defaultControl = navigate;
+    panel.addControls([save, del, edit, draw]);
     map.addControl(panel);
     map.zoomToExtent(extent, true);
 }

Modified: trunk/openlayers/examples/wfs-snap-split.html
===================================================================
--- trunk/openlayers/examples/wfs-snap-split.html	2011-05-13 22:03:55 UTC (rev 11968)
+++ trunk/openlayers/examples/wfs-snap-split.html	2011-05-16 07:12:03 UTC (rev 11969)
@@ -107,7 +107,8 @@
                 projection: new OpenLayers.Projection("EPSG:900913"),
                 units: "m",
                 controls: [
-                    new OpenLayers.Control.PanZoom()
+                    new OpenLayers.Control.PanZoom(),
+                    new OpenLayers.Control.Navigation()
                 ]
             });
 
@@ -203,9 +204,10 @@
             split.activate();
 
             // add some editing tools to a panel
-            var panel = new OpenLayers.Control.Panel(
-                {displayClass: 'customEditingToolbar'}
-            );
+            var panel = new OpenLayers.Control.Panel({
+                displayClass: 'customEditingToolbar',
+                allowDepress: true
+            });
             var draw = new OpenLayers.Control.DrawFeature(
                 wfs, OpenLayers.Handler.Path,
                 {
@@ -233,11 +235,9 @@
 
 
             panel.addControls([
-                new OpenLayers.Control.Navigation(),
                 save, del, modify, draw
             ]);
             
-            panel.defaultControl = panel.controls[0];
             map.addControl(panel);
             map.setCenter(new OpenLayers.LonLat(-11561460.5, 5541773), 15);
         }
@@ -280,8 +280,9 @@
         updating, or deleting of existing features.</p>
         <p>Use the tools to create, modify, and delete (in order from left
         to right) features.  Use the save tool (picture of a disk) to
-        save your changes.  Use the navigation tool (hand) to stop editing
-        and use the mouse for map navigation.</p>
+        save your changes.</p>
+        <p>To deactivate "drawing" or "modifying" depress the corresponding
+        button.</p>
     </div>
 
 </body>



More information about the Commits mailing list