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
This commit is contained in:
Tim Schaub
2011-04-04 21:34:56 +00:00
parent 7a5e837c9b
commit 0e27cea7f8
+10 -5
View File
@@ -29,14 +29,19 @@ var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {
}); });
function init() { function init() {
var extent = new OpenLayers.Bounds(
-11593508, 5509847, -11505759, 5557774
);
map = new OpenLayers.Map('map', { map = new OpenLayers.Map('map', {
projection: new OpenLayers.Projection("EPSG:900913"), projection: new OpenLayers.Projection("EPSG:900913"),
displayProjection: new OpenLayers.Projection("EPSG:4326"), displayProjection: new OpenLayers.Projection("EPSG:4326"),
units: "m", units: "m",
maxResolution: 156543.0339, maxResolution: 20037508.34 / 128,
maxExtent: new OpenLayers.Bounds( maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508),
-11593508, 5509847, -11505759, 5557774 restrictedExtent: extent,
),
controls: [ controls: [
new OpenLayers.Control.PanZoom() new OpenLayers.Control.PanZoom()
] ]
@@ -102,6 +107,6 @@ function init() {
panel.addControls([navigate, save, del, edit, draw]); panel.addControls([navigate, save, del, edit, draw]);
panel.defaultControl = navigate; panel.defaultControl = navigate;
map.addControl(panel); map.addControl(panel);
map.zoomToMaxExtent(); map.zoomToExtent(extent, true);
} }