[fusion-commits] r3018 - branches/fusion-mg31/layers/MapGuide

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Mar 8 05:07:59 PST 2018


Author: jng
Date: 2018-03-08 05:07:58 -0800 (Thu, 08 Mar 2018)
New Revision: 3018

Modified:
   branches/fusion-mg31/layers/MapGuide/MapGuide.js
Log:
Back out r3014, same reason as trunk

Modified: branches/fusion-mg31/layers/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-mg31/layers/MapGuide/MapGuide.js	2018-03-08 13:07:19 UTC (rev 3017)
+++ branches/fusion-mg31/layers/MapGuide/MapGuide.js	2018-03-08 13:07:58 UTC (rev 3018)
@@ -1932,16 +1932,6 @@
                 var selLayer = selLayers[i];
                 var selFeatures = selLayer.Feature || [];
                 var layerName = selLayer["@name"];
-                var layerId = selLayer["@id"];
-                var featids = [];
-                for (var l = 0; l < efi.FeatureInformation.FeatureSet[0].Layer.length; l++) {
-                    var selClass = efi.FeatureInformation.FeatureSet[0].Layer[l];
-                    if (selClass["@id"][0] == layerId[0]) {
-                        for (var j = 0; j < selClass.Class[0].ID.length; j++) {
-                            featids.push(selClass.Class[0].ID[j]);
-                        }
-                    }
-                }
                 if (!result[layerName]) {
                     if (selLayer.LayerMetadata) {
                         var layerMeta = selLayer.LayerMetadata[0];
@@ -1956,7 +1946,6 @@
                         }
                     }
                     result[layerName] = {
-                        layerId: layerId,
                         metadata: [],  //NOTE: Probably a defect, but regular code path is putting blank string arrays here too
                         metadatanames: ["dimension", "bbox", "center", "area", "length"],
                         numelements: selFeatures.length,
@@ -1963,8 +1952,7 @@
                         propertynames: pnames,
                         propertytypes: ptypes,
                         propertyvalues: pvals,
-                        values: [],
-                        featids: featids
+                        values: []
                     };
                     layerNames.push(layerName);
                 }
@@ -2032,7 +2020,7 @@
         //this.processSelectedFeatureInfo(r, false);
     },
     
-    mergeAttributes: function(attributes, prevAttributes, prevRemovals) {
+    mergeAttributes: function(attributes, prevAttributes) {
         if (!prevAttributes) {
             //Nothing to merge, return original
             return attributes;
@@ -2064,44 +2052,15 @@
         //Bring in attributes
         for (var i = 0; i < attributes.layers.length; i++) {
             var layerName = attributes.layers[i][0];
-            var layerId = merged[layerName].layerId[0];
             if (typeof(merged[layerName]) == 'undefined') {
                 merged[layerName] = attributes[layerName];
             } else {
-                var newFeatIds = attributes[layerName].featids;
                 var newValues = attributes[layerName].values;
                 for (var v = 0; v < newValues.length; v++) {
-                    var bAddThis = true;
-                    //Only add if these ids are not on the removal list
-                    if (prevRemovals[layerId]) {
-                        if (prevRemovals[layerId].removed.indexOf(newFeatIds[v]) >= 0) {
-                            bAddThis = false;
-                        }
-                    }
-                    if (bAddThis) {
-                        merged[layerName].featids.push(newFeatIds[v]);
-                        merged[layerName].values.push(newValues[v]);
-                        merged[layerName].numelements++;
-                    }
+                    merged[layerName].values.push(newValues[v]);
+                    merged[layerName].numelements++;
                 }
             }
-            //Trim off attributes at indices indicated by the previous feature key merge
-            if (prevRemovals[layerId]) {
-                var removeIndices = [];
-                for (var j = 0; j < prevRemovals[layerId].removed.length; j++) {
-                    var fid = prevRemovals[layerId].removed[j];
-                    var idx = merged[layerName].featids.indexOf(fid);
-                    if (idx >= 0) {
-                        removeIndices.push(idx);
-                    }
-                }
-                removeIndices.reverse();
-                for (var j = 0; j < removeIndices.length; j++) {
-                    var removeIndex = removeIndices[j];
-                    merged[layerName].numelements--;
-                    merged[layerName].values.splice(removeIndex, 1);
-                }
-            }
         }
         return merged;
     },
@@ -2112,8 +2071,8 @@
         var attributes = this.convertExtendedFeatureInfo(o);
         if (mergeSelection == true)
         {
-            var removals = sel.merge(this.previousSelection);
-            attributes = this.mergeAttributes(attributes, this.previousAttributes, removals);
+            sel.merge(this.previousSelection);
+            attributes = this.mergeAttributes(attributes, this.previousAttributes);
         }
         var selText = sel.getSelectionXml();
         this.previousSelection = sel;
@@ -2256,7 +2215,6 @@
 
     merge : function(previousSelection)
     {
-        var removals = {};
         if (previousSelection != null && previousSelection.nLayers > 0)
         {
             for (var prevSelIndex = 0; prevSelIndex < previousSelection.nLayers; prevSelIndex++)
@@ -2263,14 +2221,8 @@
             {
                 var prevSelLayer = previousSelection.aLayers[prevSelIndex];
 
-                var layerName = prevSelLayer.getName();
-                if (!removals[layerName]) {
-                    removals[layerName] = {
-                        removed: []
-                    }
-                }
                 // find the previously selected layer name in the current selection
-                var currentLayer = this.getLayerByName(layerName);
+                var currentLayer = this.getLayerByName(prevSelLayer.getName());
                 if (currentLayer != null)
                 {
                     // add the previously selected features for this layer
@@ -2287,14 +2239,6 @@
                             currentLayer.removeFeatures(prevSelFeatureIndexes);
                         }
                     }
-                    // Any feat ids in the prev selection not in the new one, record their indices so we
-                    // can trim off attributes at those indices
-                    for (var k = 0; k < prevSelLayer.featIds.length; k++) {
-                        var fid = prevSelLayer.featIds[k];
-                        if (currentLayer.featIds.indexOf(fid) < 0) {
-                            removals[layerName].removed.push(fid);
-                        }
-                    }
                     if (currentLayer.featIds.length == 0)
                     {
                         this.clear();
@@ -2314,7 +2258,6 @@
                 }
             }
         }
-        return removals;
     },
 
     clear: function()



More information about the fusion-commits mailing list