[fusion-commits] r2615 - in branches/fusion-mg24: . layers/Generic lib widgets widgets/FeatureInfo widgets/QuickPlot

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Oct 4 22:18:37 PDT 2012


Author: jng
Date: 2012-10-04 22:18:37 -0700 (Thu, 04 Oct 2012)
New Revision: 2615

Modified:
   branches/fusion-mg24/
   branches/fusion-mg24/layers/Generic/Generic.js
   branches/fusion-mg24/lib/ApplicationDefinition.js
   branches/fusion-mg24/lib/MapMessage.js
   branches/fusion-mg24/widgets/BasemapSwitcher.js
   branches/fusion-mg24/widgets/FeatureInfo.js
   branches/fusion-mg24/widgets/FeatureInfo/featureinfomain.php
   branches/fusion-mg24/widgets/QuickPlot/GeneratePicture.php
   branches/fusion-mg24/widgets/QuickPlot/PreviewDialog.js
Log:
Merge r2608 and r2614 from trunk


Property changes on: branches/fusion-mg24
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/jxlib-3.0:1957-2248
/trunk:2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/jxlib-3.0:1957-2248
/trunk:2563,2565,2567,2569,2576,2578-2583,2585,2608-2614

Modified: branches/fusion-mg24/layers/Generic/Generic.js
===================================================================
--- branches/fusion-mg24/layers/Generic/Generic.js	2012-10-05 05:11:02 UTC (rev 2614)
+++ branches/fusion-mg24/layers/Generic/Generic.js	2012-10-05 05:18:37 UTC (rev 2615)
@@ -61,6 +61,14 @@
         this.bMapLoaded = false;
 
         this.triggerEvent(Fusion.Event.LAYER_LOADING);
+        
+        this.internalLoadMap(resourceId);
+        
+        //this.triggerEvent(Fusion.Event.LAYER_LOADED);
+        window.setTimeout(OpenLayers.Function.bind(this.asyncTrigger, this),1);
+    },
+
+    internalLoadMap: function(resourceId) {
         if (this.bIsMapWidgetLayer) {
           this.mapWidget._addWorker();
         }
@@ -251,9 +259,6 @@
           this.mapWidget.addMap(this);
           this.mapWidget._removeWorker();
         }
-        
-        //this.triggerEvent(Fusion.Event.LAYER_LOADED);
-        window.setTimeout(OpenLayers.Function.bind(this.asyncTrigger, this),1);
     },
     
     asyncTrigger: function() {
@@ -272,12 +277,15 @@
         this.triggerEvent(Fusion.Event.LAYER_LOADED);
     },
     
-//TBD: this function not yet converted for OL    
+    //TBD: this function not yet converted for OL    
     reloadMap: function() {
+        this.bMapLoaded = false;
         
-        this.loadMap(this.sResourceId);
-            this.mapWidget.triggerEvent(Fusion.Event.MAP_RELOADED);
-            this.drawMap();
+        this.internalLoadMap(this.sResourceId);
+        this.mapWidget.triggerEvent(Fusion.Event.MAP_RELOADED);
+        this.drawMap();
+        
+        this.bMapLoaded = true;
     },
     
     drawMap: function() {


Property changes on: branches/fusion-mg24/lib/ApplicationDefinition.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/adsk/2.4j/lib/ApplicationDefinition.js:2486-2514
/sandbox/jxlib-3.0/lib/ApplicationDefinition.js:1957-2248
/trunk/lib/ApplicationDefinition.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/adsk/2.4j/lib/ApplicationDefinition.js:2486-2514
/sandbox/jxlib-3.0/lib/ApplicationDefinition.js:1957-2248
/trunk/lib/ApplicationDefinition.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585,2608-2614


Property changes on: branches/fusion-mg24/lib/MapMessage.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/adsk/2.4j/lib/MapMessage.js:2486-2514
/sandbox/jxlib-3.0/lib/MapMessage.js:1957-2248
/trunk/lib/MapMessage.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/adsk/2.4j/lib/MapMessage.js:2486-2514
/sandbox/jxlib-3.0/lib/MapMessage.js:1957-2248
/trunk/lib/MapMessage.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585,2608-2614


Property changes on: branches/fusion-mg24/widgets/BasemapSwitcher.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/adsk/2.4j/widgets/BasemapSwitcher.js:2486-2526
/sandbox/jxlib-3.0/widgets/BasemapSwitcher.js:1957-2248
/trunk/widgets/BasemapSwitcher.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/adsk/2.4j/widgets/BasemapSwitcher.js:2486-2526
/sandbox/jxlib-3.0/widgets/BasemapSwitcher.js:1957-2248
/trunk/widgets/BasemapSwitcher.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585,2608-2614

Modified: branches/fusion-mg24/widgets/FeatureInfo/featureinfomain.php
===================================================================
--- branches/fusion-mg24/widgets/FeatureInfo/featureinfomain.php	2012-10-05 05:11:02 UTC (rev 2614)
+++ branches/fusion-mg24/widgets/FeatureInfo/featureinfomain.php	2012-10-05 05:18:37 UTC (rev 2615)
@@ -57,6 +57,10 @@
     $noLayerInfoLocal = GetLocalizedString('FEATUREINFONOINFO', $locale );
     $noFeatureInLocal = GetLocalizedString('FEATUREINFONOFEATUREIN', $locale );
 
+    $drawPointLocal = GetLocalizedString("REDLINEEDITPOINTHELP", $locale );
+    $drawRectLocal = GetLocalizedString("REDLINEEDITRECTANGLEHELP", $locale );
+    $drawPolyLocal = GetLocalizedString("REDLINEEDITPOLYGONHELP", $locale );
+
     try
     {
         $featureInfo = new FeatureInfo($args);
@@ -95,6 +99,10 @@
         var session = '<?= $args['SESSION'] ?>';
         var mapName = '<?= $args['MAPNAME'] ?>';
 
+        var DRAW_POINT_HELP = '<?= $drawPointLocal ?>';
+        var DRAW_RECT_HELP = '<?= $drawRectLocal ?>';
+        var DRAW_POLY_HELP = '<?= $drawPolyLocal ?>';
+
         var properties = null;
         var results;
 
@@ -119,11 +127,23 @@
             map.clearSelection();
         }
 
+        function SetMessage(msg) {
+            var map = GetFusionMapWidget();
+            map.message.info(msg);
+        }
+
+        function ClearMessage() {
+            var map = GetFusionMapWidget();
+            map.message.clear();
+        }
+
         function OnDigitizePoint() {
+            SetMessage(DRAW_POINT_HELP);
             DigitizePoint(OnPointDigitized);
         }
 
         function OnPointDigitized(point) {
+            ClearMessage();
             var tolerance = GetFusionMapWidget().pixToGeoMeasure(3);
             var min = {x:point.X-tolerance,y:point.Y-tolerance};
             var max = {x:point.X+tolerance,y:point.Y+tolerance};
@@ -132,22 +152,26 @@
             SetSpatialFilter(geom);
         }
         function OnDigitizeRectangle() {
+            SetMessage(DRAW_RECT_HELP);
             DigitizeRectangle(OnRectangleDigitized);
         }
 
         function OnRectangleDigitized(rectangle) {
-          var min = rectangle.Point1;
-          var max = rectangle.Point2;
-          var geom = 'POLYGON(('+ min.X + ' ' +  min.Y + ', ' +  max.X + ' ' +  min.Y + ', ' + max.X + ' ' +  max.Y + ', ' + min.X + ' ' +  max.Y + ', ' + min.X + ' ' +  min.Y + '))';
+            ClearMessage();
+            var min = rectangle.Point1;
+            var max = rectangle.Point2;
+            var geom = 'POLYGON(('+ min.X + ' ' +  min.Y + ', ' +  max.X + ' ' +  min.Y + ', ' + max.X + ' ' +  max.Y + ', ' + min.X + ' ' +  max.Y + ', ' + min.X + ' ' +  min.Y + '))';
 
-          SetSpatialFilter(geom);
+            SetSpatialFilter(geom);
         }
 
         function OnDigitizePolygon() {
+            SetMessage(DRAW_POLY_HELP);
             DigitizePolygon(OnPolyonDigitized);
         }
 
         function OnPolyonDigitized(polygon) {
+            ClearMessage();
             var points = [];
             for (var i = 0; i < polygon.Count; i++) {
                 points.push(polygon.Point(i).X+' '+polygon.Point(i).Y);
@@ -267,10 +291,11 @@
         }
 
         function OnUnload() {
-          var map = GetFusionMapWidget();
-          map.deregisterForEvent(Fusion.Event.MAP_SELECTION_ON, SelectionOn);
-          map.deregisterForEvent(Fusion.Event.MAP_SELECTION_OFF, SelectionOff);
-          map.deregisterForEvent(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED, ActiveLayerChange);
+            ClearDigitization(true);
+            var map = GetFusionMapWidget();
+            map.deregisterForEvent(Fusion.Event.MAP_SELECTION_ON, SelectionOn);
+            map.deregisterForEvent(Fusion.Event.MAP_SELECTION_OFF, SelectionOff);
+            map.deregisterForEvent(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED, ActiveLayerChange);
         }
 
     </script>

Modified: branches/fusion-mg24/widgets/FeatureInfo.js
===================================================================
--- branches/fusion-mg24/widgets/FeatureInfo.js	2012-10-05 05:11:02 UTC (rev 2614)
+++ branches/fusion-mg24/widgets/FeatureInfo.js	2012-10-05 05:18:37 UTC (rev 2615)
@@ -42,6 +42,7 @@
     isExclusive: true,
     uiClass: Jx.Button,
     sFeatures: 'menubar=no,location=no,resizable=no,status=no',
+    oTarget: null,
 
     initializeWidget: function(widgetTag) {
         var json = widgetTag.extension;
@@ -53,7 +54,7 @@
         var url = this.sBaseUrl;
         //add in other parameters to the url here
 
-        var map = this.getMap();
+        this.mapWidget = this.getMap();
         var widgetLayer = this.getMapLayer();
         var taskPaneTarget = Fusion.getWidgetById(this.sTarget);
         var pageElement = $(this.sTarget);
@@ -79,12 +80,22 @@
             {
                 taskPaneTarget.setContent(url);
             }
+            this.oTarget = taskPaneTarget.iframe.contentWindow;
         } else {
             if ( pageElement ) {
                 pageElement.src = url;
+                this.oTarget = pageElement;
             } else {
-                window.open(url, this.sTarget, this.sWinFeatures);
+                this.oTarget = window.open(url, this.sTarget, this.sWinFeatures);
             }
         }
+    },
+
+    deactivate: function() {
+        this.mapWidget.message.clear();
+        //This function exists if MapGuideViewerApi.js was included in
+        if (this.oTarget && this.oTarget.ClearDigitization) {
+            this.oTarget.ClearDigitization(true);
+        }
     }
 });


Property changes on: branches/fusion-mg24/widgets/QuickPlot/GeneratePicture.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php:2488-2498
/sandbox/jxlib-3.0/widgets/QuickPlot/GeneratePicture.php:1957-2248
/trunk/widgets/QuickPlot/GeneratePicture.php:2469-2487,2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/adsk/2.4jbeta2/widgets/QuickPlot/GeneratePicture.php:2488-2498
/sandbox/jxlib-3.0/widgets/QuickPlot/GeneratePicture.php:1957-2248
/trunk/widgets/QuickPlot/GeneratePicture.php:2469-2487,2563,2565,2567,2569,2576,2578-2583,2585,2608-2614


Property changes on: branches/fusion-mg24/widgets/QuickPlot/PreviewDialog.js
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/adsk/2.4j/widgets/QuickPlot/PreviewDialog.js:2486-2528
/sandbox/jxlib-3.0/widgets/QuickPlot/PreviewDialog.js:1957-2248
/trunk/widgets/QuickPlot/PreviewDialog.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585
   + /sandbox/adsk/2.4j/widgets/QuickPlot/PreviewDialog.js:2486-2528
/sandbox/jxlib-3.0/widgets/QuickPlot/PreviewDialog.js:1957-2248
/trunk/widgets/QuickPlot/PreviewDialog.js:2469-2485,2563,2565,2567,2569,2576,2578-2583,2585,2608-2614



More information about the fusion-commits mailing list