[fusion-commits] r1451 - trunk/lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Aug 7 16:04:54 EDT 2008
Author: madair
Date: 2008-08-07 16:04:53 -0400 (Thu, 07 Aug 2008)
New Revision: 1451
Modified:
trunk/lib/Map.js
Log:
closes #74: added check to see if the initialView falls within the map maxExtent
Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js 2008-08-06 13:44:51 UTC (rev 1450)
+++ trunk/lib/Map.js 2008-08-07 20:04:53 UTC (rev 1451)
@@ -60,6 +60,7 @@
_nDpi : 96,
_oCurrentExtents: null,
_oInitialExtents: null,
+ maxExtent: new OpenLayers.Bounds(),
_nWorkers: 0,
oContextMenu: null,
bSupressContextMenu: false,
@@ -297,6 +298,7 @@
this.singleTile = false;
}
this.projection = map.projection;
+ this.maxExtent.extend(map._oMaxExtent);
//if bRestrictExtent is null, use the default OL behaviour with somewhat restricted map navigation
//if bRestrictExtent is set to true, map navigation is limited to the map extent
@@ -545,6 +547,10 @@
} else if (iv.minX) {
this._oInitialExtents = new OpenLayers.Bounds(iv.minX, iv.minY, iv.maxX, iv.maxY);
}
+ if (!this._oInitialExtents.intersectsBounds(this.maxExtent)) {
+ Fusion.reportError("AppDef initial view is outside map maxExtent, resetting initialView to maxExtent");
+ this._oInitialExtents = this.maxExtent;
+ }
} else {
var viewSize = this.oMapOL.getSize();
var oExtents = this.oMapOL.getMaxExtent();
More information about the fusion-commits
mailing list