[Mapbender-commits] r10152 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 17 03:06:46 PDT 2019


Author: armin11
Date: 2019-06-17 03:06:46 -0700 (Mon, 17 Jun 2019)
New Revision: 10152

Modified:
   trunk/mapbender/http/php/mod_sessionWrapper.php
Log:
Possibility to write dummy multipolygon into session - for testing purposes only

Modified: trunk/mapbender/http/php/mod_sessionWrapper.php
===================================================================
--- trunk/mapbender/http/php/mod_sessionWrapper.php	2019-06-17 10:02:14 UTC (rev 10151)
+++ trunk/mapbender/http/php/mod_sessionWrapper.php	2019-06-17 10:06:46 UTC (rev 10152)
@@ -99,29 +99,30 @@
 			$value = urldecode($testMatch);
 			$testMatch = NULL;
 		} else {
-//generate dummy gml and put it into session:
-/*$bbox = "6,48,8,51";
-$newBbox = explode(",", $bbox);
-$GML = '<FeatureCollection xmlns:gml="http://www.opengis.net/gml"><boundedBy><Box srsName="EPSG:4326">';
-$GML .= "<coordinates>".$newBbox[0].",".$newBbox[1]." ".$newBbox[2];
-$GML .= ",".$newBbox[3]."</coordinates></Box>";
-$GML .= '</boundedBy><featureMember><gemeinde><title>BBOX</title><the_geom><MultiPolygon srsName="EPSG:';
-$GML .= "4326".'"><polygonMember><Polygon><outerBoundaryIs><LinearRing><coordinates>';
-$GML .= $newBbox[0].",".$newBbox[1]." ".$newBbox[2].",";
-$GML .= $newBbox[1]." ".$newBbox[2].",".$newBbox[3]." ";
-$GML .= $newBbox[0].",".$newBbox[3]." ".$newBbox[0].",".$newBbox[1];
-$GML .= "</coordinates></LinearRing></outerBoundaryIs></Polygon></polygonMember></MultiPolygon></the_geom></gemeinde></featureMember></FeatureCollection>";
-Mapbender::session()->set('GML',$GML);
-$resultObj['success'] = true;
-$resultObj['message'] = 'Dummy GML written into session!'; 
-$resultObj['result'] = null;
-echo json_encode($resultObj);
-die();*/
     			$resultObj['message'] = 'Parameter value for key '.$key.' not given!'; 
     			$resultObj['result'] = null;
     			echo json_encode($resultObj);
 			die();
 		}
+		if ($value == 'dummyPolygon') {
+			$bbox = "6,48,8,51";
+			$newBbox = explode(",", $bbox);
+			$GML = '<FeatureCollection xmlns:gml="http://www.opengis.net/gml"><boundedBy><Box srsName="EPSG:4326">';
+			$GML .= "<coordinates>".$newBbox[0].",".$newBbox[1]." ".$newBbox[2];
+			$GML .= ",".$newBbox[3]."</coordinates></Box>";
+			$GML .= '</boundedBy><featureMember><gemeinde><title>BBOX</title><the_geom><MultiPolygon srsName="EPSG:';
+			$GML .= "4326".'"><polygonMember><Polygon><outerBoundaryIs><LinearRing><coordinates>';
+			$GML .= $newBbox[0].",".$newBbox[1]." ".$newBbox[2].",";
+			$GML .= $newBbox[1]." ".$newBbox[2].",".$newBbox[3]." ";
+			$GML .= $newBbox[0].",".$newBbox[3]." ".$newBbox[0].",".$newBbox[1];
+			$GML .= "</coordinates></LinearRing></outerBoundaryIs></Polygon></polygonMember></MultiPolygon></the_geom></gemeinde></featureMember></FeatureCollection>";
+			Mapbender::session()->set('GML', $GML);
+			$resultObj['success'] = true;
+			$resultObj['message'] = 'Dummy GML MultiPolygon written into session!'; 
+			$resultObj['result'] = null;
+			echo json_encode($resultObj);
+			die();
+		}
 		Mapbender::session()->set('GML',$value);
 		$resultObj['success'] = true;
 		$resultObj['message'] = 'GML written into session!'; 



More information about the Mapbender_commits mailing list