[fusion-commits] r2934 - in branches/fusion-mg26: . layers/MapGuide lib/OpenLayers lib/OpenLayers/ext/OpenLayers/Layer/Google widgets

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Apr 18 05:29:50 PDT 2016


Author: jng
Date: 2016-04-18 05:29:50 -0700 (Mon, 18 Apr 2016)
New Revision: 2934

Modified:
   branches/fusion-mg26/
   branches/fusion-mg26/layers/MapGuide/MapGuide.js
   branches/fusion-mg26/lib/OpenLayers/OpenLayers.js
   branches/fusion-mg26/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js
   branches/fusion-mg26/widgets/Legend.js
Log:
Merged revision(s) 2920-2932 from trunk:
#634, http://trac.osgeo.org/fusion/ticket/634
It is because Fusion.Lib.MGRequest.MGQueryMapFeatures2 has a parameter 'selText', which is too long when selecting multiple features. We have to use 'post' in this case. 
........

........
Fix the issue that Google street base layer cannot be loaded.
........
Fix the issue that Google street base layer cannot be loaded.
........
Revert revision #2912 because it is for 2.6. It should not be merged to 3.0+ versions.
........
User 'post' for MGQueryMapFeatures2 because the selText could be a very long string. 
........
Fix error that base layer legend cannot be displayed. 
The type of base layer tree item/folder is Jx.TreeItem/Jx.TreeFolder.
........
#639: Fix Google Maps init sequence. This incorporates the following upstream changes from the ol2 github repo:

 - Fix Google layer init sequence (https://github.com/openlayers/ol2/commit/482e61aad4ba758897524f607f7986ece1655327)
 - Fix node not found on Firefox and/or slow connections (https://github.com/openlayers/ol2/commit/7a82b4a1ba8ebcfac912a85418ebaf598d4dac4d)
........
This incorporates r2928 into the single-file OpenLayers.js (which is a fresh uncompressed build of OL2 using our fusion.cfg with custom modifications in lib/OpenLayers/ext overlaid on top)
........
Merged revision(s) 2925 from sandbox/adsk/3.1n:
Revert revision #2912 because it is for 2.6. It should not be merged to 3.0+ versions.
........

........
Merged revision(s) 2926 from sandbox/adsk/3.1n:
User 'post' for MGQueryMapFeatures2 because the selText could be a very long string. 
........

........
Merged revision(s) 2927 from sandbox/adsk/3.1n:
Fix error that base layer legend cannot be displayed. 
The type of base layer tree item/folder is Jx.TreeItem/Jx.TreeFolder.
........

........



Property changes on: branches/fusion-mg26
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/fusion-mg24:2560
/sandbox/adsk/2.6l:2911
/sandbox/createruntimemap:2699-2708
/sandbox/jxlib-3.0:1957-2248
/sandbox/ol213:2801-2803
/sandbox/robust_error_handling:2818-2825
/trunk:2847,2850,2857,2859,2862-2863,2872,2877,2880,2882,2884,2893-2897,2899,2905-2908,2915
   + /branches/fusion-mg24:2560
/sandbox/adsk/2.6l:2911
/sandbox/adsk/3.1n:2925-2927
/sandbox/createruntimemap:2699-2708
/sandbox/jxlib-3.0:1957-2248
/sandbox/ol213:2801-2803
/sandbox/robust_error_handling:2818-2825
/trunk:2847,2850,2857,2859,2862-2863,2872,2877,2880,2882,2884,2893-2897,2899,2905-2908,2915,2920-2932

Modified: branches/fusion-mg26/layers/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-mg26/layers/MapGuide/MapGuide.js	2016-04-18 11:54:42 UTC (rev 2933)
+++ branches/fusion-mg26/layers/MapGuide/MapGuide.js	2016-04-18 12:29:50 UTC (rev 2934)
@@ -1252,7 +1252,12 @@
                                                                  this.selectionColor,
                                                                  this.selectionImageFormat);
             var callback = OpenLayers.Function.bind(this.onNativeSelectionUpdate, this, zoomTo, returnAttributes);
+            // use 'post' because selText could be a long string.
+            var method = Fusion.oBroker.method;
+            Fusion.oBroker.method = 'post';
+            r.options.contentType = 'application/x-www-form-urlencoded';
             Fusion.oBroker.dispatchRequest(r, callback);
+            Fusion.oBroker.method = method;
         } else {
             var sl = Fusion.getScriptLanguage();
             var updateSelectionScript = 'layers/' + this.arch + '/' + sl  + '/SaveSelection.' + sl;

Modified: branches/fusion-mg26/lib/OpenLayers/OpenLayers.js
===================================================================
--- branches/fusion-mg26/lib/OpenLayers/OpenLayers.js	2016-04-18 11:54:42 UTC (rev 2933)
+++ branches/fusion-mg26/lib/OpenLayers/OpenLayers.js	2016-04-18 12:29:50 UTC (rev 2934)
@@ -8727,7 +8727,7 @@
             
             var bounds = this.getExtent();
             
-            //send the move call to the baselayer and all the overlays
+            //send the move call to the baselayer and all the overlays    
             if (zoom && this.baseLayer.CLASS_NAME != "OpenLayers.Layer.MapGuide") {
                 if (zoom >= this.baseLayer.MAX_ZOOM_LEVEL)
                     this.baseLayer.setVisibility(false);
@@ -40917,22 +40917,28 @@
             if (visible === true) {
                 if (container.parentNode !== map.div) {
                     if (!cache.rendered) {
+                        container.style.visibility = 'hidden';
                         var me = this;
                         google.maps.event.addListenerOnce(this.mapObject, 'tilesloaded', function() {
                             cache.rendered = true;
-                            me.setGMapVisibility(me.getVisibility());
+                            container.style.visibility = '';
+                            me.setGMapVisibility(true);
                             me.moveTo(me.map.getCenter());
+                            cache.googleControl.appendChild(map.viewPortDiv);
+                            me.setGMapVisibility(me.visible);
                         });
                     } else {
-                        map.div.appendChild(container);
                         cache.googleControl.appendChild(map.viewPortDiv);
-                        google.maps.event.trigger(this.mapObject, 'resize');
                     }
+                    map.div.appendChild(container);
+                    google.maps.event.trigger(this.mapObject, 'resize');
                 }
-                this.mapObject.setMapTypeId(type);                
+                this.mapObject.setMapTypeId(type);
             } else if (cache.googleControl.hasChildNodes()) {
                 map.div.appendChild(map.viewPortDiv);
-                map.div.removeChild(container);
+                if (map.div.contains(container)) {
+                    map.div.removeChild(container);
+                }
             }
         }
     },

Modified: branches/fusion-mg26/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js
===================================================================
--- branches/fusion-mg26/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js	2016-04-18 11:54:42 UTC (rev 2933)
+++ branches/fusion-mg26/lib/OpenLayers/ext/OpenLayers/Layer/Google/v3.js	2016-04-18 12:29:50 UTC (rev 2934)
@@ -152,22 +152,28 @@
             if (visible === true) {
                 if (container.parentNode !== map.div) {
                     if (!cache.rendered) {
+                        container.style.visibility = 'hidden';
                         var me = this;
                         google.maps.event.addListenerOnce(this.mapObject, 'tilesloaded', function() {
                             cache.rendered = true;
-                            me.setGMapVisibility(me.getVisibility());
+                            container.style.visibility = '';
+                            me.setGMapVisibility(true);
                             me.moveTo(me.map.getCenter());
+                            cache.googleControl.appendChild(map.viewPortDiv);
+                            me.setGMapVisibility(me.visible);
                         });
                     } else {
-                        map.div.appendChild(container);
                         cache.googleControl.appendChild(map.viewPortDiv);
-                        google.maps.event.trigger(this.mapObject, 'resize');
                     }
+                    map.div.appendChild(container);
+                    google.maps.event.trigger(this.mapObject, 'resize');
                 }
-                this.mapObject.setMapTypeId(type);                
+                this.mapObject.setMapTypeId(type);
             } else if (cache.googleControl.hasChildNodes()) {
                 map.div.appendChild(map.viewPortDiv);
-                map.div.removeChild(container);
+                if (map.div.contains(container)) {
+                    map.div.removeChild(container);
+                }
             }
         }
     },

Modified: branches/fusion-mg26/widgets/Legend.js
===================================================================
--- branches/fusion-mg26/widgets/Legend.js	2016-04-18 11:54:42 UTC (rev 2933)
+++ branches/fusion-mg26/widgets/Legend.js	2016-04-18 12:29:50 UTC (rev 2934)
@@ -636,7 +636,8 @@
                 if (!layer.legend.treeItem) {
                     layer.legend.treeItem = this.createFolderItem(layer);
                     this.addLayerTreeItem(layer.parentGroup.legend.treeItem, layer.legend.treeItem);
-                } else if (layer.legend.treeItem instanceof Fusion.Widget.Legend.TreeItem) {
+                } else if (layer.legend.treeItem instanceof Fusion.Widget.Legend.TreeItem ||
+                           layer.legend.treeItem instanceof Jx.TreeItem) {
                     this.clearTreeItem(layer);
                     layer.legend.treeItem = this.createFolderItem(layer);
                     this.addLayerTreeItem(layer.parentGroup.legend.treeItem, layer.legend.treeItem);
@@ -674,7 +675,8 @@
                 if (!layer.legend.treeItem) {
                     layer.legend.treeItem = this.createTreeItem(layer, style, fScale, !layer.isBaseMapLayer);
                     this.addLayerTreeItem(layer.parentGroup.legend.treeItem, layer.legend.treeItem);
-                } else if (layer.legend.treeItem instanceof Fusion.Widget.Legend.TreeFolder) {
+                } else if (layer.legend.treeItem instanceof Fusion.Widget.Legend.TreeFolder ||
+                           layer.legend.treeItem instanceof Jx.TreeFolder) {
                     this.clearTreeItem(layer);
                     layer.legend.treeItem = this.createTreeItem(layer, style, fScale, !layer.isBaseMapLayer);
                     this.addLayerTreeItem(layer.parentGroup.legend.treeItem, layer.legend.treeItem);
@@ -840,15 +842,7 @@
                 opt.image = layer.oMap.getLegendImageURL(scale, layer, style);
             }
         }
-        // MapGuide DWF and Raster layer
-        // MapGuide Raster and DWF layer
-        if(layer.layerTypes[0] == 4){
-            opt.image = this.imgLayerRasterIcon;
-            opt.enabled = true;
-        } else if(layer.layerTypes[0] == 5){
-            opt.image = this.imgLayerDWFIcon;
-            opt.enabled = true;
-        }
+
         var item;
         if (!layer.isBaseMapLayer&&checkbox) {
             // opt.contextMenu = this.getContextMenu();



More information about the fusion-commits mailing list