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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 5 01:40:41 PDT 2014


Author: armin11
Date: 2014-08-05 01:40:41 -0700 (Tue, 05 Aug 2014)
New Revision: 9020

Modified:
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
Extract hardcoded extent of sdi area which is used to calculate the metadata extent previews into conf file

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2014-08-05 08:40:26 UTC (rev 9019)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2014-08-05 08:40:41 UTC (rev 9020)
@@ -34,8 +34,6 @@
 //get language parameter out of mapbender session if it is set else set default language to de_DE
 $sessionLang = Mapbender::session()->get("mb_lang");
 
-
-
 if (isset($sessionLang) && ($sessionLang!='')) {
 	$e = new mb_notice("mod_showMetadata.php: language found in session: ".$sessionLang);
 	$language = $sessionLang;
@@ -117,7 +115,6 @@
 	$testMatch = NULL;
 }
 
-
 $subscribe = intval($subscribe);
 
 $hostName = $_SERVER['HTTP_HOST'];
@@ -131,7 +128,6 @@
 			$mapbenderProtocol = "http://";
 }
 
-
 //Array with translations:
 switch ($languageCode) {
 	case "de":
@@ -600,8 +596,6 @@
 
 */
 
-
-
 //$e = new mb_exception("mod_showMetadata: fkey_mb_group_id from wms or wfs table: ".$resourceMetadata['fkey_mb_group_id']);
 if (!isset($resourceMetadata['fkey_mb_group_id']) or is_null($resourceMetadata['fkey_mb_group_id']) or $resourceMetadata['fkey_mb_group_id'] == 0){
 	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id not found!");
@@ -996,11 +990,6 @@
 	$html .= $t_a.$translation['crs'].$t_b.$epsgString.$t_c;
 }
 
-
-
-
-
-
 if ($resource == 'wmc') {
 	$epsgString .= $resourceMetadata['contentcrs']." ";
 	if ($resourceMetadata['contentcrs'] == 'EPSG:4326') {
@@ -1027,10 +1016,7 @@
 $html .= $t_a.$translation['wmccrs'].$t_b.$epsgString.$t_c;
 }
 
-
-
 if (isset($wgs84Bbox)) {
-	
 	$html .= $t_a.$translation['wgs84Bbox'].$t_b.$wgs84Bbox.$t_c;
 	if (defined('EXTENTSERVICEURL')) {
 		$html .= $t_a.$translation['wgs84BboxGraphic'].$t_b."<img src='".$getMapUrl."'>".$t_c;
@@ -1360,38 +1346,40 @@
     $string = mb_eregi_replace("\n", "<br>", $string);
     return $string;
 } 
+
 function getExtentGraphic($layer_4326_box) {
-		$rlp_4326_box = array(6.05,48.9,8.6,50.96);
-		if ($layer_4326_box[0] <= $rlp_4326_box[0] || $layer_4326_box[2] >= $rlp_4326_box[2] || $layer_4326_box[1] <= $rlp_4326_box[1] || $layer_4326_box[3] >= $rlp_4326_box[3]) {
-			if ($layer_4326_box[0] < $rlp_4326_box[0]) {
-				$rlp_4326_box[0] = $layer_4326_box[0]; 
+		$area_4326_box = explode(',',EXTENTSERVICEBBOX);
+		if ($layer_4326_box[0] <= $area_4326_box[0] || $layer_4326_box[2] >= $area_4326_box[2] || $layer_4326_box[1] <= $area_4326_box[1] || $layer_4326_box[3] >= $area_4326_box[3]) {
+			if ($layer_4326_box[0] < $area_4326_box[0]) {
+				$area_4326_box[0] = $layer_4326_box[0]; 
 			}
-			if ($layer_4326_box[2] > $rlp_4326_box[2]) {
-				$rlp_4326_box[2] = $layer_4326_box[2]; 
+			if ($layer_4326_box[2] > $area_4326_box[2]) {
+				$area_4326_box[2] = $layer_4326_box[2]; 
 			}
-			if ($layer_4326_box[1] < $rlp_4326_box[1]) {
-				$rlp_4326_box[1] = $layer_4326_box[1]; 
+			if ($layer_4326_box[1] < $area_4326_box[1]) {
+				$area_4326_box[1] = $layer_4326_box[1]; 
 			}
-			if ($layer_4326_box[3] > $rlp_4326_box[3]) {
-				$rlp_4326_box[3] = $layer_4326_box[3]; 
+			if ($layer_4326_box[3] > $area_4326_box[3]) {
+				$area_4326_box[3] = $layer_4326_box[3]; 
 			}
 
-			$d_x = $rlp_4326_box[2] - $rlp_4326_box[0]; 
-			$d_y = $rlp_4326_box[3] - $rlp_4326_box[1];
+			$d_x = $area_4326_box[2] - $area_4326_box[0]; 
+			$d_y = $area_4326_box[3] - $area_4326_box[1];
 			
-			$new_minx = $rlp_4326_box[0] - 0.05*($d_x);
-			$new_maxx = $rlp_4326_box[2] + 0.05*($d_x);
-			$new_miny = $rlp_4326_box[1] - 0.05*($d_y);
-			$new_maxy = $rlp_4326_box[3] + 0.05*($d_y);
+			$new_minx = $area_4326_box[0] - 0.05*($d_x);
+			$new_maxx = $area_4326_box[2] + 0.05*($d_x);
+			$new_miny = $area_4326_box[1] - 0.05*($d_y);
+			$new_maxy = $area_4326_box[3] + 0.05*($d_y);
 
-			if ($new_minx < -180) $rlp_4326_box[0] = -180; else $rlp_4326_box[0] = $new_minx;
-			if ($new_maxx > 180) $rlp_4326_box[2] = 180; else $rlp_4326_box[2] = $new_maxx;
-			if ($new_miny < -90) $rlp_4326_box[1] = -90; else $rlp_4326_box[1] = $new_miny;
-			if ($new_maxy > 90) $rlp_4326_box[3] = 90; else $rlp_4326_box[3] = $new_maxy;
+			if ($new_minx < -180) $area_4326_box[0] = -180; else $area_4326_box[0] = $new_minx;
+			if ($new_maxx > 180) $area_4326_box[2] = 180; else $area_4326_box[2] = $new_maxx;
+			if ($new_miny < -90) $area_4326_box[1] = -90; else $area_4326_box[1] = $new_miny;
+			if ($new_maxy > 90) $area_4326_box[3] = 90; else $area_4326_box[3] = $new_maxy;
 		}
-		$getMapUrl = EXTENTSERVICEURL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=".EXTENTSERVICELAYER."&STYLES=&SRS=EPSG:4326&BBOX=".$rlp_4326_box[0].",".$rlp_4326_box[1].",".$rlp_4326_box[2].",".$rlp_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&minx=".$layer_4326_box[0]."&miny=".$layer_4326_box[1]."&maxx=".$layer_4326_box[2]."&maxy=".$layer_4326_box[3];
+		$getMapUrl = EXTENTSERVICEURL."VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=".EXTENTSERVICELAYER."&STYLES=&SRS=EPSG:4326&BBOX=".$area_4326_box[0].",".$area_4326_box[1].",".$area_4326_box[2].",".$area_4326_box[3]."&WIDTH=120&HEIGHT=120&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&minx=".$layer_4326_box[0]."&miny=".$layer_4326_box[1]."&maxx=".$layer_4326_box[2]."&maxy=".$layer_4326_box[3];
 		return $getMapUrl;
 }
+
 //from php/mod_coordsLookup_server.php
 function transform ($x, $y, $oldEPSG, $newEPSG) {
 	if (is_null($x) || !is_numeric($x) || 



More information about the Mapbender_commits mailing list