[mapguide-commits] r9632 - in sandbox/jng/312_hardening/Common/MapGuideCommon: Controller System

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Nov 13 01:34:06 PST 2019


Author: jng
Date: 2019-11-13 01:34:05 -0800 (Wed, 13 Nov 2019)
New Revision: 9632

Modified:
   sandbox/jng/312_hardening/Common/MapGuideCommon/Controller/HtmlController.cpp
   sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.cpp
   sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.h
Log:
Add new configuration property to (globally) control whether QUERYMAPFEATURES is permitted to include bounds for any feature data returned.

Modified: sandbox/jng/312_hardening/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- sandbox/jng/312_hardening/Common/MapGuideCommon/Controller/HtmlController.cpp	2019-11-12 11:09:22 UTC (rev 9631)
+++ sandbox/jng/312_hardening/Common/MapGuideCommon/Controller/HtmlController.cpp	2019-11-13 09:34:05 UTC (rev 9632)
@@ -449,6 +449,16 @@
     MgWktReaderWriter wktRw;
     MgCoordinateSystemFactory csFactory;
 
+    // If specified, enable or suppress feature bounds inclusion
+    // TODO: Down the road, this could perhaps be configurable on a per-feature-source basis via
+    // its resource header metadata
+    MgConfiguration* conf = MgConfiguration::GetInstance();
+    bool includeFeatureBounds = true;
+    conf->GetBoolValue(MgConfigProperties::AgentPropertiesSection,
+        MgConfigProperties::AgentGlobalIncludeFeatureBoundsForQueryMapFeatures,
+        includeFeatureBounds,
+        MgConfigProperties::DefaultAgentGlobalIncludeFeatureBoundsForQueryMapFeatures);
+
     Ptr<MgReadOnlyLayerCollection> selLayers = selectionSet->GetLayers();
     if (NULL != selLayers.p)
     {
@@ -541,7 +551,7 @@
             {
                 xmlOut.append(L"<Feature>\n");
                 STRING geomPropName = selLayer->GetFeatureGeometryName();
-                if (!reader->IsNull(geomPropName))
+                if (includeFeatureBounds && !reader->IsNull(geomPropName))
                 {
                     try 
                     {

Modified: sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.cpp	2019-11-12 11:09:22 UTC (rev 9631)
+++ sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.cpp	2019-11-13 09:34:05 UTC (rev 9632)
@@ -553,6 +553,8 @@
 const INT32  MgConfigProperties::DefaultAgentGlobalGetWfsFeaturesLimit                      = 0;
 const STRING MgConfigProperties::AgentGlobalGetWmsFeatureInfoLimit                          = L"GlobalGetWmsFeatureInfoLimit";
 const INT32  MgConfigProperties::DefaultAgentGlobalGetWmsFeatureInfoLimit                   = 0;
+const STRING MgConfigProperties::AgentGlobalIncludeFeatureBoundsForQueryMapFeatures         = L"GlobalIncludeFeatureBoundsForQueryMapFeatures";
+const bool   MgConfigProperties::DefaultAgentGlobalIncludeFeatureBoundsForQueryMapFeatures  = true;
 
 // ******************************************************************
 // OGC Properties

Modified: sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.h	2019-11-12 11:09:22 UTC (rev 9631)
+++ sandbox/jng/312_hardening/Common/MapGuideCommon/System/ConfigProperties.h	2019-11-13 09:34:05 UTC (rev 9632)
@@ -961,8 +961,11 @@
     /// Global limit for QUERYMAPFEATURES
     static const STRING AgentGlobalMaxMapFeatureQueryLimit;             /// value("GlobalMaxMapFeatureQueryLimit")
     static const INT32  DefaultAgentGlobalMaxMapFeatureQueryLimit;      /// value(0)
-    
 
+    /// Global flag to toggle feature bounds inclusion in QUERYMAPFEATURES response
+    static const STRING AgentGlobalIncludeFeatureBoundsForQueryMapFeatures;      /// value("GlobalIncludeFeatureBoundsForQueryMapFeatures")
+    static const bool DefaultAgentGlobalIncludeFeatureBoundsForQueryMapFeatures; /// value(true)
+
     /// OGC PROPERTIES SECTION -------------------------------------------------------------------------------------------
 
     /// Ogc properties



More information about the mapguide-commits mailing list