[mapguide-commits] r8609 - in sandbox/adsk/3.0m: Common/MapGuideCommon/Controller Server/src/Services/Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Mar 31 19:12:29 PDT 2015
Author: hubu
Date: 2015-03-31 19:12:28 -0700 (Tue, 31 Mar 2015)
New Revision: 8609
Modified:
sandbox/adsk/3.0m/Common/MapGuideCommon/Controller/HtmlController.cpp
sandbox/adsk/3.0m/Server/src/Services/Rendering/ServerRenderingService.cpp
Log:
Merge #2548 and #2526 to sandbox/adsk/3.0m branch.
Modified: sandbox/adsk/3.0m/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- sandbox/adsk/3.0m/Common/MapGuideCommon/Controller/HtmlController.cpp 2015-04-01 02:05:13 UTC (rev 8608)
+++ sandbox/adsk/3.0m/Common/MapGuideCommon/Controller/HtmlController.cpp 2015-04-01 02:12:28 UTC (rev 8609)
@@ -278,17 +278,26 @@
// Call the C++ API, regardless of bitmask as any part of the mask will require information from this API
featureInfo = service->QueryFeatures(map, layerNames, selectionGeometry, selectionVariant, featureFilter, maxFeatures, layerAttributeFilter);
+ Ptr<MgSelection> selection;
+ if (NULL != featureInfo.p)
+ selection = featureInfo->GetSelection();
+
+ bool bSetMap = true;
+ if (!selection)
+ {
+ selection = new MgSelection(map);
+ bSetMap = false;
+ }
+
if (persist)
{
//save the selection set in the session repository
- Ptr<MgSelection> selection;
- if (NULL != featureInfo.p)
- selection = featureInfo->GetSelection();
- if(!selection)
- selection = new MgSelection(map);
selection->Save(resourceService, mapName);
- newSelection = SAFE_ADDREF(selection.p);
+ }
+ newSelection = SAFE_ADDREF(selection.p);
+ if (bSetMap)
+ {
//Needed for GetLayers() to work below
newSelection->SetMap(map);
}
@@ -524,7 +533,8 @@
}
}
}
- propNames->Add(selLayer->GetFeatureGeometryName()); //Don't forget geometry
+ if (!propNames->Contains(selLayer->GetFeatureGeometryName()))
+ propNames->Add(selLayer->GetFeatureGeometryName()); //Don't forget geometry
xmlOut.append(L"</LayerMetadata>\n");
Ptr<MgReader> reader = selectionSet->GetSelectedFeatures(selLayer, selLayer->GetFeatureClassName(), propNames);
while(reader->ReadNext())
Modified: sandbox/adsk/3.0m/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- sandbox/adsk/3.0m/Server/src/Services/Rendering/ServerRenderingService.cpp 2015-04-01 02:05:13 UTC (rev 8608)
+++ sandbox/adsk/3.0m/Server/src/Services/Rendering/ServerRenderingService.cpp 2015-04-01 02:12:28 UTC (rev 8609)
@@ -1424,9 +1424,11 @@
ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%t) RenderForSelection(): ** START **\n")));
CHECKARGUMENTNULL(map, L"MgServerRenderingService.RenderForSelection");
- if ((NULL == geometry && featureFilter.empty()))
- throw new MgNullArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"", NULL);
+ //No geometry or selection XML = nothing to do.
+ if (geometry == NULL && featureFilter.empty())
+ return;
+
if (maxFeatures < 0)
{
STRING buffer;
More information about the mapguide-commits
mailing list