[fusion-commits] r1546 - in branches/fusion-1.1: lib widgets widgets/widgetinfo

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Sep 23 15:34:14 EDT 2008


Author: madair
Date: 2008-09-23 15:34:14 -0400 (Tue, 23 Sep 2008)
New Revision: 1546

Modified:
   branches/fusion-1.1/lib/Map.js
   branches/fusion-1.1/widgets/InitialMapView.js
   branches/fusion-1.1/widgets/widgetinfo/initialmapview.xml
Log:
closes #130

Modified: branches/fusion-1.1/lib/Map.js
===================================================================
--- branches/fusion-1.1/lib/Map.js	2008-09-23 17:01:44 UTC (rev 1545)
+++ branches/fusion-1.1/lib/Map.js	2008-09-23 19:34:14 UTC (rev 1546)
@@ -567,6 +567,7 @@
                                            center.lon + w_deg,
                                            center.lat + h_deg);
       }
+      this.initialExtents = initialExtents;
       return initialExtents; 
     },
 

Modified: branches/fusion-1.1/widgets/InitialMapView.js
===================================================================
--- branches/fusion-1.1/widgets/InitialMapView.js	2008-09-23 17:01:44 UTC (rev 1545)
+++ branches/fusion-1.1/widgets/InitialMapView.js	2008-09-23 19:34:14 UTC (rev 1546)
@@ -32,8 +32,14 @@
 
 
 Fusion.Widget.InitialMapView = OpenLayers.Class(Fusion.Widget, Fusion.Tool.ButtonBase,  {
+    viewType: 'initial',
+    
     initialize : function(widgetTag) {
         //console.log('InitialMapView.initialize');
+        var json = widgetTag.extension;
+        if (json.ViewType && (json.ViewType[0] == 'full')) {
+          this.viewType = 'full';
+        }
 
         Fusion.Widget.prototype.initialize.apply(this, [widgetTag, false]);
         Fusion.Tool.ButtonBase.prototype.initialize.apply(this, []);
@@ -41,6 +47,11 @@
 
     execute: function() {
         //console.log('InitialMapView.activateTool');
-        this.getMap().fullExtents();
+        if (this.viewType == 'full') {
+          this.getMap().fullExtents();
+        } else {
+          var mapWidget = this.getMap();
+          mapWidget.setExtents(mapWidget.initialExtents);
+        }
     }
 });

Modified: branches/fusion-1.1/widgets/widgetinfo/initialmapview.xml
===================================================================
--- branches/fusion-1.1/widgets/widgetinfo/initialmapview.xml	2008-09-23 17:01:44 UTC (rev 1545)
+++ branches/fusion-1.1/widgets/widgetinfo/initialmapview.xml	2008-09-23 19:34:14 UTC (rev 1546)
@@ -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