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

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Apr 4 17:34:59 EDT 2011


Author: tschaub
Date: 2011-04-04 14:34:56 -0700 (Mon, 04 Apr 2011)
New Revision: 11872

Modified:
   trunk/openlayers/examples/wfs-protocol-transactions.js
Log:
Things break when map maxExtent does not match the Google maxExtent and a Google layer is used as the base layer (see #3242).

Modified: trunk/openlayers/examples/wfs-protocol-transactions.js
===================================================================
--- trunk/openlayers/examples/wfs-protocol-transactions.js	2011-04-04 17:15:14 UTC (rev 11871)
+++ trunk/openlayers/examples/wfs-protocol-transactions.js	2011-04-04 21:34:56 UTC (rev 11872)
@@ -29,14 +29,19 @@
 });
 
 function init() {
+
+    var extent = new OpenLayers.Bounds(
+        -11593508, 5509847, -11505759, 5557774
+    );
+
+
     map = new OpenLayers.Map('map', {
         projection: new OpenLayers.Projection("EPSG:900913"),
         displayProjection: new OpenLayers.Projection("EPSG:4326"),
         units: "m",
-        maxResolution: 156543.0339,
-        maxExtent: new OpenLayers.Bounds(
-            -11593508, 5509847, -11505759, 5557774
-        ),
+        maxResolution: 20037508.34 / 128,
+        maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508),
+        restrictedExtent: extent,
         controls: [
             new OpenLayers.Control.PanZoom()
         ]
@@ -47,7 +52,7 @@
     );
 
     var saveStrategy = new OpenLayers.Strategy.Save();
-
+    
     wfs = new OpenLayers.Layer.Vector("Editable Features", {
         strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
         projection: new OpenLayers.Projection("EPSG:4326"),
@@ -102,6 +107,6 @@
     panel.addControls([navigate, save, del, edit, draw]);
     panel.defaultControl = navigate;
     map.addControl(panel);
-    map.zoomToMaxExtent();
+    map.zoomToExtent(extent, true);
 }
 



More information about the Commits mailing list