[fusion-commits] r2355 - in branches/fusion-2.2: layers/MapGuide lib widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Mar 29 16:36:25 EDT 2011


Author: madair
Date: 2011-03-29 13:36:25 -0700 (Tue, 29 Mar 2011)
New Revision: 2355

Modified:
   branches/fusion-2.2/layers/MapGuide/MapGuide.js
   branches/fusion-2.2/lib/Map.js
   branches/fusion-2.2/widgets/Maptip.js
Log:
re #437: allow maptips to be propagated to any of the layers in a map group

Modified: branches/fusion-2.2/layers/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-2.2/layers/MapGuide/MapGuide.js	2011-03-29 19:46:36 UTC (rev 2354)
+++ branches/fusion-2.2/layers/MapGuide/MapGuide.js	2011-03-29 20:36:25 UTC (rev 2355)
@@ -1228,7 +1228,8 @@
         if (h) {
           this.oMaptip.h = h[0];
         }
-        this.mapWidget.triggerEvent(Fusion.Event.MAP_MAPTIP_REQ_FINISHED, this.oMaptip);
+        if (this.oMaptip.t != "" || this.oMaptip.h != "")
+            this.mapWidget.triggerEvent(Fusion.Event.MAP_MAPTIP_REQ_FINISHED, this.oMaptip);
     },
     
     getLegendImageURL: function(fScale, layer, style,defaultIcon) {

Modified: branches/fusion-2.2/lib/Map.js
===================================================================
--- branches/fusion-2.2/lib/Map.js	2011-03-29 19:46:36 UTC (rev 2354)
+++ branches/fusion-2.2/lib/Map.js	2011-03-29 20:36:25 UTC (rev 2355)
@@ -44,7 +44,6 @@
 Fusion.Event.MAP_MAPTIP_REQ_FINISHED = Fusion.Event.lastEventId++;
 Fusion.Event.MAP_MAP_GROUP_LOADED = Fusion.Event.lastEventId++;
 
-
 Fusion.Constant.LAYER_POINT_TYPE = 0;
 Fusion.Constant.LAYER_LINE_TYPE = 1;
 Fusion.Constant.LAYER_POLYGON_TYPE = 2;
@@ -98,7 +97,7 @@
 
     /** flag to indicate if the map is tiled or not, set in the Map extension */
     singleTile: true,
-
+    
     /** flag to indicate if fractional zoom is supported, ie. allow any scale
     *   value rather than a fixed set of scales
     */
@@ -1420,8 +1419,16 @@
      },
 
      getMapTip: function(oMapTips) {
-        //TODO send this to the correct aMap object
-        this.aMaps[0].getMapTip(oMapTips);
+        var scale = this.getScale();
+        for (var i = this.aMaps.length - 1; i >= 0; i--)
+        {
+            var mp = this.aMaps[i];
+            //Guard against queries on a non-visible map. Problematic in MapGuide
+            if (scale >= mp.minScale && scale <= mp.maxScale)
+            {
+                mp.getMapTip(oMapTips);
+            }
+        }
      },
 
      supressContextMenu: function( bSupress ) {

Modified: branches/fusion-2.2/widgets/Maptip.js
===================================================================
--- branches/fusion-2.2/widgets/Maptip.js	2011-03-29 19:46:36 UTC (rev 2354)
+++ branches/fusion-2.2/widgets/Maptip.js	2011-03-29 20:36:25 UTC (rev 2355)
@@ -185,6 +185,8 @@
     },
     
     _display: function(eventID,oMapTip) {
+        if (!this.mapTipFired)
+            return;
         if (typeof(oMapTip) == "undefined" || oMapTip.t == '') {
             return;
         }



More information about the fusion-commits mailing list