[mapguide-commits] r4661 - sandbox/rfc71/mapviewerphp

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Mar 11 11:03:39 EST 2010


Author: jng
Date: 2010-03-11 11:03:39 -0500 (Thu, 11 Mar 2010)
New Revision: 4661

Modified:
   sandbox/rfc71/mapviewerphp/getselectedfeatures.php
Log:
#1053: Fix up the sample JSON fragment in the comments and add a missing brace for null zoom points.

Modified: sandbox/rfc71/mapviewerphp/getselectedfeatures.php
===================================================================
--- sandbox/rfc71/mapviewerphp/getselectedfeatures.php	2010-03-11 15:26:06 UTC (rev 4660)
+++ sandbox/rfc71/mapviewerphp/getselectedfeatures.php	2010-03-11 16:03:39 UTC (rev 4661)
@@ -243,31 +243,31 @@
         
     //FB::log("Processing JSON response");
     /*
-    A sample of the JSON output this method will produce:
+	A sample of the JSON output this method will produce:
+	
+	
+	{
+		"Layer1" : [ 
+			{ 
+				'values' { "name" : "name1" , "value" : "value1" }, 
+				'zoom' : { x: num1, y: num2 } 
+			} , 
+			..,
+			..,
+			..,
+		],
+		"Layer2" : [ 
+			{ 
+				'values' { "name" : "name2" , "value" : "value2" }, 
+				'zoom' : { x: num1, y: num2 } 
+			} , 
+			..,
+			..,
+			..,
+		]
+	}
+	*/
     
-    
-    {
-        "Layer1" : [ 
-            { 
-                'values' { "prop1" : "value1" , "prop2" : "value2" }, 
-                'zoom' : { x: num1, y: num2 } 
-            } , 
-            ..,
-            ..,
-            ..,
-        ],
-        "Layer2" : [ 
-            { 
-                'values' { "prop1" : "value1" , "prop2" : "value2" }, 
-                'zoom' : { x: num1, y: num2 } 
-            } , 
-            ..,
-            ..,
-            ..,
-        ]
-    }
-    */
-    
     $layers = $selectionSet->GetLayers();
     $totalLayers = array(); //The data portion of the JSON response
     
@@ -276,6 +276,7 @@
     for ($i = 0; $i < count($layers); $i++)
     {   
         $layerName = $layers[$i];
+		
         $features = $selectionSet->GetFeatures($layerName);
         
         //FB::log("Features: ".$features);
@@ -305,7 +306,7 @@
                     if($feat->zoom != null)
                         array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : { \"x\": ".$feat->zoom->x.", \"y\": ".$feat->zoom->y." } }");
                     else
-                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null }");
+                        array_push($totalFeaturesOnLayer, "{\"values\" : [".join(",", $featureProperties)."], \"zoom\" : null } }");
                         
                     //FB::log("Feature processed on layer: $layerName");
                 }



More information about the mapguide-commits mailing list