[fusion-commits] r2533 - trunk/widgets/SelectWithin

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Apr 23 02:43:43 EDT 2012


Author: liuar
Date: 2012-04-22 23:43:43 -0700 (Sun, 22 Apr 2012)
New Revision: 2533

Modified:
   trunk/widgets/SelectWithin/SelectWithin.php
   trunk/widgets/SelectWithin/SelectWithinPanel.templ
Log:
Submit on behalf of Spark Liu: Fix for ticket 522.

Use the same way as select widget to update selection set in browser.



Modified: trunk/widgets/SelectWithin/SelectWithin.php
===================================================================
--- trunk/widgets/SelectWithin/SelectWithin.php	2012-04-23 06:33:30 UTC (rev 2532)
+++ trunk/widgets/SelectWithin/SelectWithin.php	2012-04-23 06:43:43 UTC (rev 2533)
@@ -122,15 +122,15 @@
 
               /*save selection in the session*/
               $_SESSION['selection_array'] = $properties;
-            } else { echo "/* layers false or 0 */"; }
-          } else { echo "/* no resultsel */"; }
-        } else { echo "/* no fi */"; }
-      } else { echo "/*no multi geom*/"; }
-    } else { echo "/* no layers */"; }
+              echo str_replace("</FeatureSet>", "</FeatureSet></FeatureInformation>", str_replace("<FeatureSet", "<FeatureInformation><FeatureSet", $resultSel->ToXml()));
+            } else { echo "<!--layers false or 0-->"; }
+          } else { echo "<!--no resultsel-->"; }
+        } else { echo "<!--no fi-->"; }
+      } else { echo "<!--no multi geom-->"; }
+    } else { echo "<!--no layers-->"; }
 
-    header('Content-type: application/json');
-    header('X-JSON: true');
-    echo var2json($result);
+    //return XML
+    header("Content-type: text/xml");
   } catch(MgException $e) {
     echo "\nException: " . $e->GetDetails();
     return;

Modified: trunk/widgets/SelectWithin/SelectWithinPanel.templ
===================================================================
--- trunk/widgets/SelectWithin/SelectWithinPanel.templ	2012-04-23 06:33:30 UTC (rev 2532)
+++ trunk/widgets/SelectWithin/SelectWithinPanel.templ	2012-04-23 06:43:43 UTC (rev 2533)
@@ -98,7 +98,8 @@
 
 function selectedSuccess(r) {
     var mapWidget = GetParent().Fusion.getMapByName(mapName);
-    mapWidget.processQueryResults(zoomTo, r);
+    var callback = GetParent().OpenLayers.Function.bind(mapWidget.processFeatureInfo, mapWidget);
+    GetParent().Fusion.xml2json(callback, r);
 }
 
 function selectedError(r) {
@@ -144,7 +145,7 @@
 }
 
 function GetParent()
-{debugger;
+{
 	if(popup)
 		return opener;
 	else



More information about the fusion-commits mailing list