[fusion-commits] r1577 - in branches/fusion-1.1: MapGuide lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Oct 1 10:45:17 EDT 2008


Author: madair
Date: 2008-10-01 10:45:17 -0400 (Wed, 01 Oct 2008)
New Revision: 1577

Modified:
   branches/fusion-1.1/MapGuide/MapGuide.js
   branches/fusion-1.1/lib/Map.js
Log:
re #113: fix for regression, explicitly set MaxScale in AppDef MapWidget extension to set limit for zooming out

Modified: branches/fusion-1.1/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-1.1/MapGuide/MapGuide.js	2008-10-01 14:37:02 UTC (rev 1576)
+++ branches/fusion-1.1/MapGuide/MapGuide.js	2008-10-01 14:45:17 UTC (rev 1577)
@@ -479,7 +479,7 @@
       var layerOptions = {
         units : this.units,
         isBaseLayer : bIsBaseLayer,
-        maxExtent : this.mapWidget.maxExtent?this.mapWidget.maxExtent:this._oMaxExtent,
+        maxExtent : this._oMaxExtent,
         maxResolution : 'auto',
         ratio : this.ratio
       };
@@ -494,7 +494,9 @@
       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;
+        if (this.mapWidget.minScale) {
+          layerOptions.minScale = this.mapWidget.maxScale;
+        }// otherwise minscale is set automatically by OL
       }
       layerOptions.maxScale = this.minScale;
 

Modified: branches/fusion-1.1/lib/Map.js
===================================================================
--- branches/fusion-1.1/lib/Map.js	2008-10-01 14:37:02 UTC (rev 1576)
+++ branches/fusion-1.1/lib/Map.js	2008-10-01 14:45:17 UTC (rev 1577)
@@ -68,6 +68,7 @@
     layerRoot: null,
     singleTile: true,
     fractionalZoom: true,  //TODO: set this in AppDef?
+    maxScale: null, //set this to a large number in AppDef to zoom out beyond maxExtent, e.g. 1 billion
     
     /**
      * construct a new view Fusion.Widget.Map class.  
@@ -96,6 +97,12 @@
           this.fractionalZoom = false;
         }
         
+        //Set a MaxScale in MapWIdget extension to allow zoom out to that scale
+        //otherwise, MaxScale is calculated automatically
+        if (widgetTag.extension.MaxScale) {
+          this.maxScale = parseInt(widgetTag.extension.MaxExtent[0]);
+        }
+        
         var maxExtent = null;
         if (widgetTag.extension.MaxExtent) {
           maxExtent = OpenLayers.Bounds.fromString(widgetTag.extension.MaxExtent[0]);



More information about the fusion-commits mailing list