[Mapbender-commits] r9613 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Sep 30 01:28:10 PDT 2016
Author: armin11
Date: 2016-09-30 01:28:10 -0700 (Fri, 30 Sep 2016)
New Revision: 9613
Modified:
trunk/mapbender/lib/class_GetApi.php
Log:
New possibility to set an offset in [m] if zoom to external geojson is demanded
Modified: trunk/mapbender/lib/class_GetApi.php
===================================================================
--- trunk/mapbender/lib/class_GetApi.php 2016-09-30 08:27:50 UTC (rev 9612)
+++ trunk/mapbender/lib/class_GetApi.php 2016-09-30 08:28:10 UTC (rev 9613)
@@ -19,6 +19,7 @@
private $wmc = array();
private $zoom = array();
private $geojsonzoom;
+ private $geojsonzoomscale;
/**
* @param array $input
@@ -50,6 +51,9 @@
case "GEOJSONZOOM":
$this->geojsonzoom = $this->normalizeGeojsonZoomInput($value);
break;
+ case "GEOJSONZOOMOFFSET":
+ $this->geojsonzoomoffset = $this->normalizeGeojsonZoomOffsetInput($value);
+ break;
case "ZOOM":
$this->zoom = $this->normalizeZoomInput($value);
break;
@@ -105,6 +109,15 @@
return $this->geojsonzoom;
}
+ /*
+ *
+ *
+ */
+ public function getGeojsonZoomOffset(){
+ return $this->geojsonzoomoffset;
+ }
+
+
/**
* Returns an array of zoom parameters
* @return array
@@ -331,6 +344,17 @@
}
}
+ private function normalizeGeojsonZoomOffsetInput($input){
+ //check input for integer value
+ $offset = false;
+ $testMatch = $input;
+ $pattern = '/^[\d]*$/';
+ if (preg_match($pattern,$testMatch)){
+ $offset = $testMatch;
+ }
+ return $offset;
+ }
+
}
?>
More information about the Mapbender_commits
mailing list