[mapguide-commits] r9595 - trunk/MgDev/Common/MapGuideCommon/Controller

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Aug 29 05:29:56 PDT 2019


Author: jng
Date: 2019-08-29 05:29:56 -0700 (Thu, 29 Aug 2019)
New Revision: 9595

Modified:
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
Log:
When rendering a selection key for a QUERYMAPFEATURES 4.0.0 request, make sure identity properties are part of the explicit property list when making the feature query

Fixes #2806

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2019-08-19 22:23:19 UTC (rev 9594)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2019-08-29 12:29:56 UTC (rev 9595)
@@ -539,6 +539,21 @@
             }
             if (!propNames->Contains(selLayer->GetFeatureGeometryName()))
                 propNames->Add(selLayer->GetFeatureGeometryName()); //Don't forget geometry
+
+            if (bIncludeSelectionKey)
+            {
+                //Need to make sure identity properties are part of the explicit property list
+                MgLayerBase::IdPropertyList propList = selLayer->GetIdPropertyList();
+                MgLayerBase::IdPropertyList::iterator idIter;
+                for (idIter = propList.begin(); idIter != propList.end(); ++idIter)
+                {
+                    if (!propNames->Contains(idIter->name))
+                    {
+                        propNames->Add(idIter->name);
+                    }
+                }
+            }
+
             xmlOut.append(L"</LayerMetadata>\n");
             Ptr<MgReader> reader = selectionSet->GetSelectedFeatures(selLayer, selLayer->GetFeatureClassName(), propNames);
             while (reader->ReadNext())



More information about the mapguide-commits mailing list