[fusion-commits] r1547 - in trunk: lib widgets widgets/widgetinfo

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Sep 23 15:45:16 EDT 2008


Author: madair
Date: 2008-09-23 15:45:16 -0400 (Tue, 23 Sep 2008)
New Revision: 1547

Modified:
   trunk/lib/Map.js
   trunk/widgets/InitialMapView.js
   trunk/widgets/widgetinfo/initialmapview.xml
Log:
re #130: patch applied to trunk

Modified: trunk/lib/Map.js
===================================================================
--- trunk/lib/Map.js	2008-09-23 19:34:14 UTC (rev 1546)
+++ trunk/lib/Map.js	2008-09-23 19:45:16 UTC (rev 1547)
@@ -575,6 +575,7 @@
                                            center.lon + w_deg,
                                            center.lat + h_deg);
       }
+      this.initialExtents = initialExtents;
       return initialExtents; 
     },
 

Modified: trunk/widgets/InitialMapView.js
===================================================================
--- trunk/widgets/InitialMapView.js	2008-09-23 19:34:14 UTC (rev 1546)
+++ trunk/widgets/InitialMapView.js	2008-09-23 19:45:16 UTC (rev 1547)
@@ -31,7 +31,20 @@
  * **********************************************************************/
 Fusion.Widget.InitialMapView = OpenLayers.Class(Fusion.Widget, {
     uiClass: Jx.Button,
+    viewType: 'initial',
+    initializeWidget: function(widgetTag) {           
+        var json = widgetTag.extension;
+        if (json.ViewType && (json.ViewType[0].toLowerCase() == 'full')) {
+          this.viewType = 'full';
+        }
+    },
+    
     activate: function() {
-        this.getMap().fullExtents();
+        if (this.viewType == 'full') {
+          this.getMap().fullExtents();
+        } else {
+          var mapWidget = this.getMap();
+          mapWidget.setExtents(mapWidget.initialExtents);
+        }
     }
 });

Modified: trunk/widgets/widgetinfo/initialmapview.xml
===================================================================
--- trunk/widgets/widgetinfo/initialmapview.xml	2008-09-23 19:34:14 UTC (rev 1546)
+++ trunk/widgets/widgetinfo/initialmapview.xml	2008-09-23 19:45:16 UTC (rev 1547)
@@ -10,4 +10,20 @@
   <ImageClass></ImageClass>
   <StandardUi>true</StandardUi>
   <ContainableBy>Any</ContainableBy>
+  <Parameter>
+    <Name>ViewType</Name>
+    <Description>option to zoom to full map extents or just the initial extent</Description>
+    <Type>String</Type>
+    <Label>ViewType</Label>
+    <AllowedValue>
+      <Name>full</Name>
+      <Label>full extent</Label>
+    </AllowedValue>
+    <AllowedValue>
+      <Name>initial</Name>
+      <Label>initial map extent</Label>
+    </AllowedValue>
+    <DefaultValue>initial</DefaultValue>
+    <IsMandatory>false</IsMandatory>
+  </Parameter>
 </WidgetInfo>



More information about the fusion-commits mailing list