[mapguide-commits] r8362 - in branches/2.6/MgDev: . Common/MapGuideCommon/Controller

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Sep 27 01:00:59 PDT 2014


Author: jng
Date: 2014-09-27 01:00:59 -0700 (Sat, 27 Sep 2014)
New Revision: 8362

Modified:
   branches/2.6/MgDev/
   branches/2.6/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
Log:
Merged revision(s) 8333 from trunk/MgDev:
#2479: Select features doesn't work if map has no CS.

The reason is that it will call MgCoordinateSystemFactory::Create(CREFSTRING wkt) in method MgHtmlController::QueryMapFeatures(). If the map doesn't have CS assigned, a null argument exception will be thrown. Now we add a check for map->GetMapSRS() to solve the issue.


........



Property changes on: branches/2.6/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313,8359
   + /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/sandbox/jng/createruntimemap:7486-7555
/sandbox/rfc94:5099-5163
/trunk/MgDev:8209-8210,8230,8313,8333,8359

Modified: branches/2.6/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- branches/2.6/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2014-09-27 07:11:20 UTC (rev 8361)
+++ branches/2.6/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2014-09-27 08:00:59 UTC (rev 8362)
@@ -434,7 +434,9 @@
     Ptr<MgReadOnlyLayerCollection> selLayers = selectionSet->GetLayers();
     if (NULL != selLayers.p)
     {
-        Ptr<MgCoordinateSystem> mapCs = csFactory.Create(map->GetMapSRS());
+        Ptr<MgCoordinateSystem> mapCs;
+        if (map->GetMapSRS() != L"")
+            mapCs = csFactory.Create(map->GetMapSRS());
         // Our structure is as follows
         //
         // [0...n] <SelectedLayer> - A layer containing selected features
@@ -450,7 +452,9 @@
             Ptr<MgLayerBase> selLayer = selLayers->GetItem(i);
             STRING layerName = selLayer->GetName();
 
-            Ptr<MgCoordinateSystemTransform> transform = GetLayerToMapTransform(selLayer, mapCs, &csFactory, featureService);
+            Ptr<MgCoordinateSystemTransform> transform;
+            if (mapCs)
+                transform = GetLayerToMapTransform(selLayer, mapCs, &csFactory, featureService);
 
             xmlOut.append(L"<SelectedLayer id=\"");
             xmlOut.append(selLayer->GetObjectId());



More information about the mapguide-commits mailing list