[mapguide-commits] r9137 - sandbox/adsk/3.2o.AIMS/Web/src/mapviewerjava

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Mar 21 01:54:02 PDT 2017


Author: hubu
Date: 2017-03-21 01:54:02 -0700 (Tue, 21 Mar 2017)
New Revision: 9137

Modified:
   sandbox/adsk/3.2o.AIMS/Web/src/mapviewerjava/selectwithin.jsp
Log:
#2764 Select Within returns all features when actually no result should be found

Update the JSP code.

Modified: sandbox/adsk/3.2o.AIMS/Web/src/mapviewerjava/selectwithin.jsp
===================================================================
--- sandbox/adsk/3.2o.AIMS/Web/src/mapviewerjava/selectwithin.jsp	2017-03-13 07:26:52 UTC (rev 9136)
+++ sandbox/adsk/3.2o.AIMS/Web/src/mapviewerjava/selectwithin.jsp	2017-03-21 08:54:02 UTC (rev 9137)
@@ -52,6 +52,7 @@
         site.Open(cred);
         MgFeatureService featureSrvc = (MgFeatureService)site.CreateService(MgServiceType.FeatureService);
         MgRenderingService renderingSrvc = (MgRenderingService)site.CreateService(MgServiceType.RenderingService);
+        MgResourceService resourceSrvc = (MgResourceService)site.CreateService(MgServiceType.ResourceService);
 
         //load the map runtime state
         //
@@ -81,8 +82,16 @@
                     if(resultSel != null)
                     {
                         // Return XML
-                        response.addHeader("Content-type", "text/xml");
-                        outStream.write(resultSel.ToXml());
+                        resultSel.Save(resourceSrvc, mapName);
+                        //this needs to be re-opened for some reason
+                        resultSel = new MgSelection(map);
+                        resultSel.Open(resourceSrvc, mapName);
+                        MgReadOnlyLayerCollection resLayers = resultSel.GetLayers();
+                        if (resLayers != null && resLayers.GetCount() >= 0)
+                        {
+                            response.addHeader("Content-type", "text/xml");
+                            outStream.write(resultSel.ToXml());
+                        }
                     }
                 }
             }



More information about the mapguide-commits mailing list