[Mapbender-commits] r2243 - branches/2.5/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Mar 13 11:14:21 EDT 2008


Author: verenadiewald
Date: 2008-03-13 11:14:21 -0400 (Thu, 13 Mar 2008)
New Revision: 2243

Modified:
   branches/2.5/http/php/mod_wfs_gazetteer_server.php
Log:
one step back to function parsegml, parseFile and geoJSON in version >2.5

Modified: branches/2.5/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/2.5/http/php/mod_wfs_gazetteer_server.php	2008-03-13 15:10:34 UTC (rev 2242)
+++ branches/2.5/http/php/mod_wfs_gazetteer_server.php	2008-03-13 15:14:21 UTC (rev 2243)
@@ -144,11 +144,23 @@
 	
 	$req = urldecode($url).urlencode($admin->char_decode(stripslashes($filter)));
 	$mygml = new gml2();
-	$mygml->parseFile($req);
+	$mygml->parsegml($req);
 	
-	header("Content-type:application/x-json; charset=utf-8");
-	echo $mygml->toGeoJSON();
+	// generates JavaScript code that will add a geometry array containing
+	// all the result geometries and their attributes (wfs_conf_elements)
+	
+	$js = "";
+	if ($mygml->getMemberCount() > 0) { 
+		$js .= $mygml->exportGeometriesToJS(true);
+	
+		for ($i = 0; $i < $mygml->getMemberCount(); $i++) {
+			for ($j = 0; $j < count($col); $j++){
+				$js .= "geom.get(".$i.").e.setElement('".$j."', '".$mygml->getValueBySeparatedKey($i, $col[$j]) . "');\n";
 			}
+		}
+	}
+	echo $js;
+}
 else {
 	echo "please enter a valid command.";
 }



More information about the Mapbender_commits mailing list