[mapguide-commits] r9340 - in trunk/MgDev: . Web/src/mapviewerjava Web/src/mapviewernet Web/src/mapviewerphp Web/src/viewerfiles

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Sat Mar 3 05:01:30 PST 2018


Author: jng
Date: 2018-03-03 05:01:30 -0800 (Sat, 03 Mar 2018)
New Revision: 9340

Modified:
   trunk/MgDev/
   trunk/MgDev/Web/src/mapviewerjava/selectwithin.jsp
   trunk/MgDev/Web/src/mapviewernet/selectwithin.aspx
   trunk/MgDev/Web/src/mapviewerphp/selectwithin.php
   trunk/MgDev/Web/src/viewerfiles/
   trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ
Log:
Merged revision(s) 9136-9138 from sandbox/adsk/3.2o.AIMS:
#2764 Select Within returns all features when actually no result should be found

Clear selection if there is no features in the polygon.
........
#2764 Select Within returns all features when actually no result should be found

Update the JSP code.
........
#2764 Select Within returns all features when actually no result should be found

Update the PHP code.
........


Index: trunk/MgDev
===================================================================
--- trunk/MgDev	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev	2018-03-03 13:01:30 UTC (rev 9340)

Property changes on: trunk/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
## -6,7 +6,7 ##
 /sandbox/adsk/2.6l:8727
 /sandbox/adsk/3.0m:8563,8584,8607,8625,8694-8695
 /sandbox/adsk/3.1n:8871,8895,8901,8912-8913,8921-8922,8942,9019-9020
-/sandbox/adsk/3.2o.AIMS:9135
+/sandbox/adsk/3.2o.AIMS:9135-9138
 /sandbox/jng/clean_json:8818-9180
 /sandbox/jng/cmake_v2:9259-9317
 /sandbox/jng/cmdline:9199-9217
Modified: trunk/MgDev/Web/src/mapviewerjava/selectwithin.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/selectwithin.jsp	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev/Web/src/mapviewerjava/selectwithin.jsp	2018-03-03 13:01:30 UTC (rev 9340)
@@ -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());
+                        }
                     }
                 }
             }

Modified: trunk/MgDev/Web/src/mapviewernet/selectwithin.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/selectwithin.aspx	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev/Web/src/mapviewernet/selectwithin.aspx	2018-03-03 13:01:30 UTC (rev 9340)
@@ -1,5 +1,5 @@
 <%--
-Copyright (C) 2004-2011 by Autodesk, Inc.
+Copyright (C) 2017 by Autodesk, Inc.
 This library is free software; you can redistribute it and/or
 modify it under the terms of version 2.1 of the GNU Lesser
 General Public License as published by the Free Software Foundation.
@@ -50,6 +50,7 @@
         site.Open(cred);
         MgFeatureService featureSrvc = site.CreateService(MgServiceType.FeatureService) as MgFeatureService;
         MgRenderingService renderingSrvc = site.CreateService(MgServiceType.RenderingService) as MgRenderingService;
+        MgResourceService resourceSrvc = site.CreateService(MgServiceType.ResourceService) as MgResourceService;
 
         //load the map runtime state
         //
@@ -79,8 +80,16 @@
                     if(resultSel != null)
                     {
                         // Return XML
-                        Response.AddHeader("Content-type", "text/xml");
-                        Response.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");
+                            Response.Write(resultSel.ToXml());
+                        }
                     }
                 }
             }

Modified: trunk/MgDev/Web/src/mapviewerphp/selectwithin.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/selectwithin.php	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev/Web/src/mapviewerphp/selectwithin.php	2018-03-03 13:01:30 UTC (rev 9340)
@@ -42,6 +42,7 @@
         $site->Open($cred);
         $featureSrvc = $site->CreateService(MgServiceType::FeatureService);
         $renderingSrvc = $site->CreateService(MgServiceType::RenderingService);
+        $resourceSrvc = $site->CreateService(MgServiceType::ResourceService);
 
         //load the map runtime state
         //
@@ -69,9 +70,17 @@
                     $resultSel = $fi->GetSelection();
                     if($resultSel)
                     {
-                        //return XML
-                        header("Content-type: text/xml");
-                        echo $resultSel->ToXml();
+                        // Return XML
+                        $resultSel->Save($resourceSrvc, $mapName);
+                        //this needs to be re-opened for some reason
+                        $resultSel = new MgSelection($map);
+                        $resultSel->Open($resourceSrvc, $mapName);
+                        $resLayers = $resultSel->GetLayers();
+                        if ($resLayers != null && $resLayers->GetCount() >= 0)
+                        {
+                            header("Content-type: text/xml");
+                            echo $resultSel->ToXml();
+                        }
                     }
                 }
             }

Index: trunk/MgDev/Web/src/viewerfiles
===================================================================
--- trunk/MgDev/Web/src/viewerfiles	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev/Web/src/viewerfiles	2018-03-03 13:01:30 UTC (rev 9340)

Property changes on: trunk/MgDev/Web/src/viewerfiles
___________________________________________________________________
Modified: svn:mergeinfo
## -3,6 +3,7 ##
 /branches/3.1/MgDev/Web/src/viewerfiles:9058-9059
 /sandbox/adsk/2.2gp/Web/src/viewerfiles:5392
 /sandbox/adsk/3.0m/Web/src/viewerfiles:8607
+/sandbox/adsk/3.2o.AIMS/Web/src/viewerfiles:9136-9138
 /sandbox/jng/clean_json/Web/src/viewerfiles:8818-9180
 /sandbox/jng/createruntimemap/Web/src/viewerfiles:7486-7555
 /sandbox/jng/v30/Web/src/viewerfiles:8226-8227
\ No newline at end of property
Modified: trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ	2018-03-03 12:59:57 UTC (rev 9339)
+++ trunk/MgDev/Web/src/viewerfiles/selectwithinui.templ	2018-03-03 13:01:30 UTC (rev 9340)
@@ -90,6 +90,8 @@
         reqHandler.send(reqParams);
         if(reqHandler.responseXML)
             GetParent().SetSelectionXML(reqHandler.responseText);
+        else
+            GetParent().GetMapFrame().ClearSelection();
     }
     catch(e) {}
     GetParent().GotoHomePage();



More information about the mapguide-commits mailing list