[Mapbender-commits] r8858 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 13 23:45:12 PDT 2014
Author: armin11
Date: 2014-05-13 23:45:12 -0700 (Tue, 13 May 2014)
New Revision: 8858
Modified:
trunk/mapbender/http/classes/class_metadata_new.php
Log:
Update search interface to give back scale hints for layers
Modified: trunk/mapbender/http/classes/class_metadata_new.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata_new.php 2014-05-13 14:45:18 UTC (rev 8857)
+++ trunk/mapbender/http/classes/class_metadata_new.php 2014-05-14 06:45:12 UTC (rev 8858)
@@ -746,12 +746,13 @@
$this->wmsJSON->wms->srv[$j]->layer[0]->abstract = $subLayers[$rootIndex]['layer_abstract'];
$this->wmsJSON->wms->srv[$j]->layer[0]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?languageCode=".$this->languageCode."&resource=layer&layout=tabs&id=".(integer)$subLayers[$rootIndex]['layer_id'];
$this->wmsJSON->wms->srv[$j]->layer[0]->previewURL = "http://".$this->hostName."/mapbender/geoportal/mod_showPreview.php?resource=layer&id=".(integer)$subLayers[$rootIndex]['layer_id'];
- $legendInfo = $this->getLegendInfofromLayerId($this->wmsJSON->wms->srv[$j]->layer[0]->id);
+ $legendInfo = $this->getInfofromLayerId($this->wmsJSON->wms->srv[$j]->layer[0]->id);
$this->wmsJSON->wms->srv[$j]->layer[0]->getLegendGraphicUrl = $legendInfo['getLegendGraphicUrl'];
$this->wmsJSON->wms->srv[$j]->layer[0]->getLegendGraphicUrlFormat = $legendInfo['getLegendGraphicUrlFormat'];
$this->wmsJSON->wms->srv[$j]->layer[0]->legendUrl = $legendInfo['legendUrl'];
+ $this->wmsJSON->wms->srv[$j]->layer[0]->minScale = $legendInfo['minScale'];
+ $this->wmsJSON->wms->srv[$j]->layer[0]->maxScale = $legendInfo['maxScale'];
-
if ($subLayers[$rootIndex]['layer_name'] == ''){
$this->wmsJSON->wms->srv[$j]->layer[0]->loadable = 0;
}
@@ -1452,8 +1453,8 @@
}
- private function getLegendInfofromLayerId($layerId) {
- $sql = "SELECT layer_wms.*, layer_style.legendurl, layer_style.legendurlformat FROM (SELECT layer_id, wms_getlegendurl, wms_owsproxy FROM layer INNER JOIN wms ON layer.fkey_wms_id = wms.wms_id WHERE layer.layer_id = $1) as layer_wms, layer_style where layer_style.fkey_layer_id = layer_wms.layer_id";
+ private function getInfofromLayerId($layerId) {
+ $sql = "SELECT layer_wms.*, layer_style.legendurl, layer_style.legendurlformat FROM (SELECT layer_id, layer_minscale, layer_maxscale, wms_getlegendurl, wms_owsproxy FROM layer INNER JOIN wms ON layer.fkey_wms_id = wms.wms_id WHERE layer.layer_id = $1) as layer_wms, layer_style where layer_style.fkey_layer_id = layer_wms.layer_id";
$v = array($layerId);
$t = array('i');
$res = db_prep_query($sql, $v, $t);
@@ -1462,6 +1463,8 @@
$legendUrl = $row['legendurl'];
$legendUrlFormat = $row['legendurlformat'];
$owsProxy = $row['wms_owsproxy'];
+ $minScale = $row['layer_minscale'];
+ $maxScale = $row['layer_maxscale'];
}
//hostname does not exist! - use hostname from parameter instead
if ($owsProxy != null && $owsProxy != '' && $getLegendUrl != '' && $getLegendUrl != null) {
@@ -1474,6 +1477,8 @@
$returnArray['legendUrl'] = $legendUrl;
$returnArray['getLegendGraphicUrl'] = $getLegendUrl;
$returnArray['getLegendGraphicUrlFormat'] = $legendUrlFormat;
+ $returnArray['minScale'] = $minScale;
+ $returnArray['maxScale'] = $maxScale;
return $returnArray;
}
@@ -1634,10 +1639,12 @@
$servObject->layer[$countsublayer]->name = $child['layer_name'];
$servObject->layer[$countsublayer]->abstract = $child['layer_abstract'];
$servObject->layer[$countsublayer]->previewURL = "http://".$this->hostName."/mapbender/geoportal/mod_showPreview.php?resource=layer&id=".$child['layer_id'];
- $legendInfo = $this->getLegendInfofromLayerId($servObject->layer[$countsublayer]->id);
+ $legendInfo = $this->getInfofromLayerId($servObject->layer[$countsublayer]->id);
$servObject->layer[$countsublayer]->getLegendGraphicUrl = $legendInfo['getLegendGraphicUrl'];
$servObject->layer[$countsublayer]->getLegendGraphicUrlFormat = $legendInfo['getLegendGraphicUrlFormat'];
$servObject->layer[$countsublayer]->legendUrl = $legendInfo['legendUrl'];
+ $servObject->layer[$countsublayer]->minScale = $legendInfo['minScale'];
+ $servObject->layer[$countsublayer]->maxScale = $legendInfo['maxScale'];
$servObject->layer[$countsublayer]->mdLink = "http://".$this->hostName."/mapbender/php/mod_showMetadata.php?languageCode=".$this->languageCode."&resource=layer&layout=tabs&id=".$child['layer_id'];
if ($child['layer_name'] == ''){
$servObject->layer[$countsublayer]->loadable = 0;
More information about the Mapbender_commits
mailing list