[fusion-commits] r2961 - in branches/fusion-mg31: . layers/MapGuide
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Oct 6 11:31:16 PDT 2016
Author: jng
Date: 2016-10-06 11:31:15 -0700 (Thu, 06 Oct 2016)
New Revision: 2961
Modified:
branches/fusion-mg31/
branches/fusion-mg31/layers/MapGuide/MapGuide.js
Log:
Merged revision(s) 2960 from trunk:
#653: Process selected feature attributes and respect the attribute display order controlled by the LayerMetadata element of the QUERYMAPFEATURES response.
........
Property changes on: branches/fusion-mg31
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/fusion-mg24:2560
/branches/fusion-mg26:2855,2869
/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
/sandbox/stamen:2873-2875
/sandbox/tiling:2845-2846
/trunk:2946,2950,2954,2956
+ /branches/fusion-mg24:2560
/branches/fusion-mg26:2855,2869
/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
/sandbox/stamen:2873-2875
/sandbox/tiling:2845-2846
/trunk:2946,2950,2954,2956,2960
Modified: branches/fusion-mg31/layers/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-mg31/layers/MapGuide/MapGuide.js 2016-10-06 18:02:45 UTC (rev 2960)
+++ branches/fusion-mg31/layers/MapGuide/MapGuide.js 2016-10-06 18:31:15 UTC (rev 2961)
@@ -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