svn commit: r789 - trunk/mapbender/http/print/mod_printPDF.php
astrid_emde at osgeo.org
astrid_emde at osgeo.org
Tue Oct 10 06:40:13 EDT 2006
Author: astrid_emde
Date: 2006-10-10 10:40:13+0000
New Revision: 789
Modified:
trunk/mapbender/http/print/mod_printPDF.php
Log:
WMS which are hidden, don't appear in the legend of the print anymore
Modified: trunk/mapbender/http/print/mod_printPDF.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/print/mod_printPDF.php?view=diff&rev=789&p1=trunk/mapbender/http/print/mod_printPDF.php&p2=trunk/mapbender/http/print/mod_printPDF.php&r1=788&r2=789
==============================================================================
--- trunk/mapbender/http/print/mod_printPDF.php (original)
+++ trunk/mapbender/http/print/mod_printPDF.php 2006-10-10 10:40:13+0000
@@ -89,98 +89,100 @@
for(var i=0; i<pt.mb_mapObj[ind].wms.length; i++){
- layers = pt.mb_checkScale(mod_legend_target,ind,i);
- var layer = layers[0].split(",");
- var title = layers[2].split(",");
- var temp_legendurl = layers[3].split(",");
- var layerparent= layers[4].split(",");
-
- if( pt.mb_mapObj[ind].layers[i] != "" && pt.mb_mapObj[ind].layers[i]){
-
- if(i>0){
- document.forms[0].layers.value += "___";
- document.forms[0].wms_id.value += "___";
- document.forms[0].wms_title.value += "___";
- document.forms[0].legendurl.value += "___";
- }
-
- //document.forms[0].layers.value += pt.mb_mapObj[ind].wms[i].objLayer[ii].layer_title; //pt.mb_mapObj[ind].layers[i] ;
-
- document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;
- document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
-
- //---------- legendurl ----------
- tmp_name = "";
- for(var j=0; j<layer.length; j++){
- if(layerparent[j] == 0){
- if(j>0){
- document.forms[0].layers.value += ",";
+ if(pt.mb_mapObj[ind].wms[i].gui_wms_visible != 0){
+ layers = pt.mb_checkScale(mod_legend_target,ind,i);
+ var layer = layers[0].split(",");
+ var title = layers[2].split(",");
+ var temp_legendurl = layers[3].split(",");
+ var layerparent= layers[4].split(",");
+
+ if( pt.mb_mapObj[ind].layers[i] != "" && pt.mb_mapObj[ind].layers[i]){
+
+ if(i>0 && document.forms[0].wms_id.value!=''){
+ document.forms[0].layers.value += "___";
+ document.forms[0].wms_id.value += "___";
+ document.forms[0].wms_title.value += "___";
+ document.forms[0].legendurl.value += "___";
}
-
- var l = pt.mb_getchildsbyname(ind,i,layer[j]);
-
- if (l) {
- document.forms[0].layers.value += title[j];
-
- if(j>0){
- document.forms[0].legendurl.value += ",";
+
+ //document.forms[0].layers.value += pt.mb_mapObj[ind].wms[i].objLayer[ii].layer_title; //pt.mb_mapObj[ind].layers[i] ;
+
+ document.forms[0].wms_id.value += pt.mb_mapObj[ind].wms[i].wms_id;
+ document.forms[0].wms_title.value += pt.mb_mapObj[ind].wms[i].wms_title;
+
+ //---------- legendurl ----------
+ tmp_name = "";
+ for(var j=0; j<layer.length; j++){
+ if(layerparent[j] == 0){
+ if(j>0){
+ document.forms[0].layers.value += ",";
}
- for (var k=0; k<l["name"].length; k++){
- if (tmp_name != l["title"][k]) {
- document.forms[0].layers.value += "*"
- if(k>0){
- document.forms[0].legendurl.value += "*";
- }else{
- document.forms[0].legendurl.value += '1*';
- }
-
- if (l["legendurl"][k] != '' || !l["legendurl"][k]==true){
- document.forms[0].layers.value += l["name"][k];
- document.forms[0].legendurl.value += l["legendurl"][k];
- }else{
- document.forms[0].layers.value += '0';
- document.forms[0].legendurl.value += '0';
- }
- tmp_name = l["title"][k];
- } // if
- } // for var k=0
-
- } // if (l)
- else{
- //prompt (!temp_legendurl[j] ,temp_legendurl[j] + !temp_legendurl[j]);
-
- document.forms[0].layers.value += title[j];
- if(j>0){
+
+ var l = pt.mb_getchildsbyname(ind,i,layer[j]);
+
+ if (l) {
+ document.forms[0].layers.value += title[j];
+
+ if(j>0){
document.forms[0].legendurl.value += ",";
}
- if (temp_legendurl[j]!= '' || !temp_legendurl[j] == 'true'){
- document.forms[0].legendurl.value += temp_legendurl[j];
- }else{
- document.forms[0].legendurl.value +='0';
- }
-
- }// else (l)
- }//check parent==0
- }//for var j=0
-
- //-------------------
-
- //document.forms[0].legendurl.value += layers[3];
+ for (var k=0; k<l["name"].length; k++){
+ if (tmp_name != l["title"][k]) {
+ document.forms[0].layers.value += "*"
+ if(k>0){
+ document.forms[0].legendurl.value += "*";
+ }else{
+ document.forms[0].legendurl.value += '1*';
+ }
+
+ if (l["legendurl"][k] != '' || !l["legendurl"][k]==true){
+ document.forms[0].layers.value += l["name"][k];
+ document.forms[0].legendurl.value += l["legendurl"][k];
+ }else{
+ document.forms[0].layers.value += '0';
+ document.forms[0].legendurl.value += '0';
+ }
+ tmp_name = l["title"][k];
+ } // if
+ } // for var k=0
+
+ } // if (l)
+ else{
+ //prompt (!temp_legendurl[j] ,temp_legendurl[j] + !temp_legendurl[j]);
+
+ document.forms[0].layers.value += title[j];
+ if(j>0){
+ document.forms[0].legendurl.value += ",";
+ }
+ if (temp_legendurl[j]!= '' || !temp_legendurl[j] == 'true'){
+ document.forms[0].legendurl.value += temp_legendurl[j];
+ }else{
+ document.forms[0].legendurl.value +='0';
+ }
+
+ }// else (l)
+ }//check parent==0
+ }//for var j=0
+
+ //-------------------
- } else{
- if(i>0){
- document.forms[0].layers.value += "___";
- document.forms[0].wms_id.value += "___";
- document.forms[0].wms_title.value += "___";
- document.forms[0].legendurl.value += "___";
+ //document.forms[0].legendurl.value += layers[3];
+
+ } else{
+ if(i>0 && document.forms[0].wms_id.value!=''){
+ document.forms[0].layers.value += "___";
+ document.forms[0].wms_id.value += "___";
+ document.forms[0].wms_title.value += "___";
+ document.forms[0].legendurl.value += "___";
+ }
+
+ document.forms[0].layers.value += "0";
+ document.forms[0].wms_id.value += "0";
+ document.forms[0].wms_title.value += "0";
+ document.forms[0].legendurl.value += "0";
}
-
- document.forms[0].layers.value += "0";
- document.forms[0].wms_id.value += "0";
- document.forms[0].wms_title.value += "0";
- document.forms[0].legendurl.value += "0";
- }
- }
+ }//if
+ }//for
}
function validate(){
More information about the Mapbender_commits
mailing list