[fusion-commits] r2960 - trunk/layers/MapGuide
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Oct 6 11:02:45 PDT 2016
Author: jng
Date: 2016-10-06 11:02:45 -0700 (Thu, 06 Oct 2016)
New Revision: 2960
Modified:
trunk/layers/MapGuide/MapGuide.js
Log:
#653: Process selected feature attributes and respect the attribute display order controlled by the LayerMetadata element of the QUERYMAPFEATURES response.
Modified: trunk/layers/MapGuide/MapGuide.js
===================================================================
--- trunk/layers/MapGuide/MapGuide.js 2016-09-19 15:49:43 UTC (rev 2959)
+++ trunk/layers/MapGuide/MapGuide.js 2016-10-06 18:02:45 UTC (rev 2960)
@@ -1940,10 +1940,27 @@
var feat = selFeatures[j];
var featVals = [];
if (feat.Property) {
- for (var k = 0; k < feat.Property.length; k++) {
- //Fusion represents null as empty string. Don't think that's right but we'll run with whatever
- //the old code path produces
- featVals.push(feat.Property[k].Value == null ? "" : feat.Property[k].Value[0]);
+ //If we have layer metadata, its order of properties we must follow
+ if (selLayer.LayerMetadata) {
+ for (var p = 0; p < selLayer.LayerMetadata[0].Property.length; p++) {
+ var name = selLayer.LayerMetadata[0].Property[p].DisplayName[0];
+ //Find matching property value
+ for (var fp = 0; fp < feat.Property.length; fp++) {
+ var featProp = feat.Property[fp];
+ if (featProp.Name[0] == name) {
+ //Fusion represents null as empty string. Don't think that's right but we'll run with whatever
+ //the old code path produces
+ featVals.push(featProp.Value == null ? "" : featProp.Value[0]);
+ break;
+ }
+ }
+ }
+ } else {
+ for (var k = 0; k < feat.Property.length; k++) {
+ //Fusion represents null as empty string. Don't think that's right but we'll run with whatever
+ //the old code path produces
+ featVals.push(feat.Property[k].Value == null ? "" : feat.Property[k].Value[0]);
+ }
}
}
result[layerName].values.push(featVals);
More information about the fusion-commits
mailing list