[Mapbender-commits] r8412 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Jul 4 07:59:31 PDT 2012
Author: astrid_emde
Date: 2012-07-04 07:59:30 -0700 (Wed, 04 Jul 2012)
New Revision: 8412
Modified:
trunk/mapbender/http/javascripts/mod_legend.php
Log:
new element var exclude to define wms to exclude for legend define like this [12034,24,123]
Modified: trunk/mapbender/http/javascripts/mod_legend.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_legend.php 2012-07-04 14:58:57 UTC (rev 8411)
+++ trunk/mapbender/http/javascripts/mod_legend.php 2012-07-04 14:59:30 UTC (rev 8412)
@@ -69,7 +69,17 @@
var checkbox_on_off = typeof checkbox_on_off === "undefined" ? 'false' : checkbox_on_off;
var stickylegend = typeof stickylegend === "undefined" ? "false" : stickylegend;
var reverseLegend = typeof reverseLegend === "undefined" ? "false" : reverseLegend;
+var exclude = exclude || [];
+function array_contains(hay,needle){
+ for(var i = 0; i < hay.length; i++ ){
+ if (hay[i] == needle){
+ return true
+ }
+ }
+ return false;
+}
+
function mod_legend_pos(frameName){
if(frameName == mod_legend_target){
var ind = parent.getMapObjIndexByName(mod_legend_target);
@@ -89,6 +99,9 @@
if(reverseLegend == 'true') {
for(var i=parent.mb_mapObj[ind].wms.length-1; i>=0; i--){
+ if (array_contains(exclude,parent.mb_mapObj[ind].wms[i].wms_id)){
+ continue;
+ }
var layerNames = parent.mb_mapObj[ind].wms[i].getLayers(parent.mb_mapObj[ind]);
for(var j=0; j<layerNames.length; j++){
var layerParent = parent.mb_mapObj[ind].wms[i].checkLayerParentByLayerName(layerNames[j]);
@@ -136,6 +149,9 @@
}
else {
for(var i=0; i<parent.mb_mapObj[ind].wms.length; i++){
+ if (array_contains(exclude,parent.mb_mapObj[ind].wms[i].wms_id)){
+ continue;
+ }
var layerNames = parent.mb_mapObj[ind].wms[i].getLayers(parent.mb_mapObj[ind]);
for(var j=0; j<layerNames.length; j++){
var layerParent = parent.mb_mapObj[ind].wms[i].checkLayerParentByLayerName(layerNames[j]);
More information about the Mapbender_commits
mailing list