From 0e27cea7f8562568220c2345a76fb61aa06263d8 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 4 Apr 2011 21:34:56 +0000 Subject: [PATCH] Things break when map maxExtent does not match the Google maxExtent and a Google layer is used as the base layer (see #3242). git-svn-id: http://svn.openlayers.org/trunk/openlayers@11872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/wfs-protocol-transactions.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/examples/wfs-protocol-transactions.js b/examples/wfs-protocol-transactions.js index a5a6a7cc37..8ebeb91c4f 100644 --- a/examples/wfs-protocol-transactions.js +++ b/examples/wfs-protocol-transactions.js @@ -29,14 +29,19 @@ var DeleteFeature = OpenLayers.Class(OpenLayers.Control, { }); 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 @@ function init() { ); 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 @@ function init() { panel.addControls([navigate, save, del, edit, draw]); panel.defaultControl = navigate; map.addControl(panel); - map.zoomToMaxExtent(); + map.zoomToExtent(extent, true); }