[fusion-commits] r1578 - in trunk: MapGuide lib

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Oct 1 10:46:05 EDT 2008


Author: madair
Date: 2008-10-01 10:46:05 -0400 (Wed, 01 Oct 2008)
New Revision: 1578

Modified:
   trunk/MapGuide/MapGuide.js
   trunk/lib/Map.js
Log:
closes #113: fix for regression, explicitly set MaxScale in AppDef MapWidget extension to set limit for zooming out; applied to trunk

Modified: trunk/MapGuide/MapGuide.js
===================================================================
--- trunk/MapGuide/MapGuide.js	2008-10-01 14:45:17 UTC (rev 1577)
+++ trunk/MapGuide/MapGuide.js	2008-10-01 14:46:05 UTC (rev 1578)
@@ -535,7 +535,7 @@
       var layerOptions = {
         units: this.units,
         isBaseLayer: bIsBaseLayer,
-        maxExtent: this.mapWidget.maxExtent ? this.mapWidget.maxExtent : this._oMaxExtent,
+        maxExtent: this._oMaxExtent,
         maxResolution: 'auto',
         useOverlay: this.selectionAsOverlay,
         ratio: this.ratio
@@ -551,7 +551,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
       }
       //only set both max and min scale when not using scales array
       if (!this.mapWidget.oMapOL.scales && !this.scales) {

Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js	2008-10-01 14:45:17 UTC (rev 1577)
+++ trunk/lib/Map.js	2008-10-01 14:46:05 UTC (rev 1578)
@@ -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.  
@@ -97,6 +98,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