[fusion-commits] r1564 - in branches/fusion-1.1: MapGuide lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Mon Sep 29 14:09:16 EDT 2008
Author: madair
Date: 2008-09-29 14:09:16 -0400 (Mon, 29 Sep 2008)
New Revision: 1564
Modified:
branches/fusion-1.1/MapGuide/MapGuide.js
branches/fusion-1.1/lib/Map.js
branches/fusion-1.1/lib/fusion.js
Log:
re #113: if maxScale is Infinity, set it to an actual value; set a maxExtent for panning in AppDef MapWIdget extension.
Modified: branches/fusion-1.1/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-1.1/MapGuide/MapGuide.js 2008-09-29 18:03:09 UTC (rev 1563)
+++ branches/fusion-1.1/MapGuide/MapGuide.js 2008-09-29 18:09:16 UTC (rev 1564)
@@ -479,10 +479,9 @@
var layerOptions = {
units : this.units,
isBaseLayer : bIsBaseLayer,
- maxExtent : this._oMaxExtent,
+ maxExtent : this.mapWidget.maxExtent?this.mapWidget.maxExtent:this._oMaxExtent,
maxResolution : 'auto',
ratio : this.ratio
-// transitionEffect : 'resize'
};
if (!/WebKit/.test(navigator.userAgent)) {
layerOptions.transitionEffect = 'resize';
@@ -494,10 +493,12 @@
}
if (this.maxScale != Infinity) {
layerOptions.minScale = this.maxScale; //OL interpretation of min/max scale is reversed from Fusion
+ } else {
+ layerOptions.minScale = Fusion.REALLY_SMALL_SCALE;
}
layerOptions.maxScale = this.minScale;
- layerOptions.singleTile = bSingleTile;
+ layerOptions.singleTile = bSingleTile;
var params = {};
if ( bSingleTile ) {
Modified: branches/fusion-1.1/lib/Map.js
===================================================================
--- branches/fusion-1.1/lib/Map.js 2008-09-29 18:03:09 UTC (rev 1563)
+++ branches/fusion-1.1/lib/Map.js 2008-09-29 18:09:16 UTC (rev 1564)
@@ -96,6 +96,11 @@
this.fractionalZoom = false;
}
+ var maxExtent = null;
+ if (widgetTag.extension.MaxExtent) {
+ maxExtent = OpenLayers.Bounds.fromString(widgetTag.extension.MaxExtent[0]);
+ }
+
OpenLayers.DOTS_PER_INCH = this._nDpi;
if (!this.oMapOL) {
var options = {
@@ -107,6 +112,10 @@
if (widgetTag.extension.ConstrainMapExtent) {
this.bRestrictExtent = widgetTag.extension.ConstrainMapExtent[0]=='true'?true:false;
}
+ if (maxExtent) {
+ options.maxExtent = maxExtent;
+ this.maxExtent = maxExtent;
+ }
this.oMapOL = new OpenLayers.Map(this._sDomObj, options );
}
@@ -298,7 +307,12 @@
this.singleTile = false;
}
this.projection = map.projection;
+ this.units = map.units;
this.maxExtent.extend(map._oMaxExtent);
+ this.oMapOL.setOptions({
+ maxExtent: this.maxExtent,
+ units: map.units,
+ projection: this.projection});
//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
@@ -556,6 +570,7 @@
initialExtents = this.maxExtent;
}
} else {
+ /*
var viewSize = this.oMapOL.getSize();
var oExtents = this.oMapOL.getMaxExtent();
var center = oExtents.getCenterLonLat();
@@ -567,6 +582,11 @@
center.lat - h_deg,
center.lon + w_deg,
center.lat + h_deg);
+ */
+ initialExtents = new OpenLayers.Bounds();
+ for (var i=0; i<this.aMaps.length; ++i) {
+ initialExtents.extend(this.aMaps[i]._oMaxExtent);
+ }
}
this.initialExtents = initialExtents;
return initialExtents;
Modified: branches/fusion-1.1/lib/fusion.js
===================================================================
--- branches/fusion-1.1/lib/fusion.js 2008-09-29 18:03:09 UTC (rev 1563)
+++ branches/fusion-1.1/lib/fusion.js 2008-09-29 18:09:16 UTC (rev 1564)
@@ -211,6 +211,8 @@
aUnitAbbr: ['unk', 'in', 'ft', 'yd', 'mi', 'nm',
'mm', 'cm', 'm', 'km',
'°', '°', '°', 'px'],
+ REALLY_SMALL_SCALE: 1000000000,
+
/**
* Function: initialize
*
More information about the fusion-commits
mailing list