[fusion-commits] r2963 - in branches/fusion-mg26: . layers/MapGuide
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Thu Oct 6 11:31:46 PDT 2016
Author: jng
Date: 2016-10-06 11:31:46 -0700 (Thu, 06 Oct 2016)
New Revision: 2963
Modified:
branches/fusion-mg26/
branches/fusion-mg26/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-mg26
___________________________________________________________________
Modified: svn:mergeinfo
- /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,2936-2942,2946,2950,2956
+ /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,2936-2942,2946,2950,2956,2960
Modified: branches/fusion-mg26/layers/MapGuide/MapGuide.js
===================================================================
--- branches/fusion-mg26/layers/MapGuide/MapGuide.js 2016-10-06 18:31:28 UTC (rev 2962)
+++ branches/fusion-mg26/layers/MapGuide/MapGuide.js 2016-10-06 18:31:46 UTC (rev 2963)
@@ -1916,10 +1916,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