AW: [Mapbender-users] Getting info on layer status, selected or not?

Kesting, Arne Arne.Kesting at
Wed Feb 25 05:30:19 EST 2009

Hi Christoph, 

thanks for the detailed advice. I will try it and have a look at map.js and map_obj.js.

Mit freundlichen Grüßen
Arne Kesting
Stadt Velbert
Technische Verwaltungsdienste
Geodaten und Vermessung
Am Lindenkamp 31, Raum 228
42549 Velbert

Tel.: 02051/26-2647
Fax: 02051/26-2784
Email: arne.kesting at
-----Ursprüngliche Nachricht-----
Von: mapbender_users-bounces at [mailto:mapbender_users-bounces at] Im Auftrag von Christoph Baudson
Gesendet: Mittwoch, 25. Februar 2009 11:21
An: Mapbender User List
Betreff: Re: [Mapbender-users] Getting info on layer status, selected or not?

Hi Arne,

Kesting, Arne schrieb:
> Hello,
> this is the problem:
> I want to adjust the pdf print output according to the layer which is 
> currently selected.
> Here is a small example. 
> If layer A is selected i want to write text1 into the mapframe (pdf
> output) an if layer B is selected,
> please write text2 into the mapframe.
> How can i get the status or info of a specific layer? Is it 
> selected(on) or not (off)?
> Everything should be implemented into an already user-defined 
> mod_printPDF_pdf.php file.
> I don't know how to access the above mentioned information about the 
> layers.
> Thanks for any help on this topic.

This will be a bit tricky. You would need to send the status information of your layers to the server side PHP.

The layers are stored in a wms object, which itself is stored in a map object. The layer attribute you want to query is "gui_layer_visible". 
Assume you know the name of your map , which is presumably "mapframe1", the WMS ID in the database (let's say, 543), and the layer name
("myLayerName") here's a JavaScript code snippet.

var layer = mb_getLayerObjByName("mapframe1", 543, "myLayerName");

You'll find the function in map.js. Take a look at the file in order to learn more. You might also want to take a look at map_obj.js, where the wms and layer object are defined. You can retrieve the attribute like this

var myLayersVisibility = layer.gui_layer_visibile;

You could then set the value a hidden form field to myLayersVisibility, and by this, send it to the server side.

This is all a bit awkward, as the print module doesn't yet use AJAX. I hope this helps at least a bit.


> best regards
> Arne Kesting
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at



 FOSSGIS Konferenz 2009
 17.-19. März 2009 in Hannover



W h e r e G r o u p GmbH & Co. KG

Siemensstraße 8
53121 Bonn

Christoph Baudson

Fon: +49 (0)228 / 90 90 38 - 15
Fax: +49 (0)228 / 90 90 38 - 11
christoph.baudson at
Amtsgericht Bonn, HRA 6788

WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm

Mapbender_users mailing list
Mapbender_users at

More information about the Mapbender_users mailing list