[Mapbender-commits] r9609 - trunk/mapbender/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 29 08:18:23 PDT 2016


Author: armin11
Date: 2016-09-29 08:18:22 -0700 (Thu, 29 Sep 2016)
New Revision: 9609

Modified:
   trunk/mapbender/lib/class_GetApi.php
Log:
New possibility to integrate distributed or local geojson files in the initial wmc for the gui by using some get parameter

Modified: trunk/mapbender/lib/class_GetApi.php
===================================================================
--- trunk/mapbender/lib/class_GetApi.php	2016-09-29 15:18:05 UTC (rev 9608)
+++ trunk/mapbender/lib/class_GetApi.php	2016-09-29 15:18:22 UTC (rev 9609)
@@ -15,8 +15,10 @@
 	private $featuretypes = array();
 	private $geoRSSFeeds = array();
 	private $kml = array();
+	private $geojson = array();
 	private $wmc = array();
 	private $zoom = array();
+	private $geojsonzoom;
 	
 	/**
 	 * @param array $input
@@ -42,6 +44,12 @@
 				case "KML":
 					$this->kml = $this->normalizeKmlInput($value);
 					break;
+				case "GEOJSON":
+					$this->geojson = $this->normalizeGeojsonInput($value);
+					break;
+				case "GEOJSONZOOM":
+					$this->geojsonzoom = $this->normalizeGeojsonZoomInput($value);
+					break;
 				case "ZOOM":
 					$this->zoom = $this->normalizeZoomInput($value);
 					break;
@@ -71,7 +79,6 @@
 	 */
 	public function getGeoRSSFeeds(){
 		return $this->geoRSSFeeds;
-
 	}
 
 	/*
@@ -80,9 +87,24 @@
 	 */
 	public function getKml(){
 		return $this->kml;
+	}
 
+	/*
+	 * 
+	 *
+	 */
+	public function getGeojson(){
+		return $this->geojson;
 	}
 
+	/*
+	 * 
+	 *
+	 */
+	public function getGeojsonZoom(){
+		return $this->geojsonzoom;
+	}
+
 	/**
 	 * Returns an array of zoom parameters
 	 * @return array
@@ -290,9 +312,25 @@
 	private function normalizeGeoRSSInput($input){
 		return is_array($input) ? $input : array($input);
 	}
+
 	private function normalizeKmlInput($input){
 		return is_array($input) ? $input : array($input);
 	}
+
+	private function normalizeGeojsonInput($input){
+		return is_array($input) ? $input : array($input);
+	}
+
+	private function normalizeGeojsonZoomInput($input){
+		if ($input == 'true') {
+			//$e = new mb_exception("set geojsonzoom to true");
+			return 'true';
+		} else {
+			//$e = new mb_exception("set geojsonzoom to false");
+			return 'false';
+		}
+	}
+
 }
 
 ?>



More information about the Mapbender_commits mailing list