[mapguide-commits] r8901 - sandbox/adsk/3.1n/Server/src/Services/Rendering

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Apr 5 00:23:16 PDT 2016


Author: hubu
Date: 2016-04-05 00:23:16 -0700 (Tue, 05 Apr 2016)
New Revision: 8901

Modified:
   sandbox/adsk/3.1n/Server/src/Services/Rendering/ServerRenderingService.cpp
Log:
Fix a bug introduced by RFC #151.
The scale range will be changed in the method RenderForSelection if bOnlyVisibleLayers is false. So we cannot use the cached layer definition in this case.

Modified: sandbox/adsk/3.1n/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- sandbox/adsk/3.1n/Server/src/Services/Rendering/ServerRenderingService.cpp	2016-03-31 11:31:48 UTC (rev 8900)
+++ sandbox/adsk/3.1n/Server/src/Services/Rendering/ServerRenderingService.cpp	2016-04-05 07:23:16 UTC (rev 8901)
@@ -1574,14 +1574,22 @@
         if (maxFeatures <= 0)
             break;
 
-        //get the MDF layer definition
+        MdfModel::VectorLayerDefinition* vl = NULL;
         Ptr<MgResourceIdentifier> layerResId = layer->GetLayerDefinition();
-        MgCacheManager* cacheManager = MgCacheManager::GetInstance();
-        Ptr<MgResourceLayerDefinitionCacheItem> cacheItem = cacheManager->GetResourceLayerDefinitionCacheItem(layerResId);
-        MdfModel::LayerDefinition* layerDefinition = cacheItem->Get();
+        if (bOnlyVisibleLayers)
+        {
+            //get the MDF layer definition
+            MgCacheManager* cacheManager = MgCacheManager::GetInstance();
+            Ptr<MgResourceLayerDefinitionCacheItem> cacheItem = cacheManager->GetResourceLayerDefinitionCacheItem(layerResId);
+            MdfModel::LayerDefinition* layerDefinition = cacheItem->Get();
+            vl = dynamic_cast<MdfModel::VectorLayerDefinition*>(layerDefinition);
+        }
+        else
+        {
+            auto_ptr<MdfModel::LayerDefinition> ldf(MgLayerBase::GetLayerDefinition(m_svcResource, layerResId));
+            vl = dynamic_cast<MdfModel::VectorLayerDefinition*>(ldf.get());
+        }
 
-        MdfModel::VectorLayerDefinition* vl = dynamic_cast<MdfModel::VectorLayerDefinition*>(layerDefinition);
-
         //we can only do geometric query selection for vector layers
         if (vl)
         {



More information about the mapguide-commits mailing list