[mapserver-users] PHP/Mapscript - globally manipulating layer status?

Antti.Roppola at brs.gov.au Antti.Roppola at brs.gov.au
Tue Oct 29 17:29:43 PST 2002


Hello all,

When rendering a key, I want to consider map layers
on a case-by-case basis so I can insert text between
key elements.

However, before I can do this I need to set every layer
in the map to "off" before I can switched them on individually:

for($n=0; $n<$num_layers; $n++) {
	$layer=$map->getLayer($n);
	$layer->set("status",0);
}

Instead of all this looping, is it possible to globally switch
the status of every layer? Say:

	$map->set("layer[]->status",0);

Or even better, apply the same operation to an arbitrary set:

	map->set("layer[$selected_layers]->status",1);

Cheers,

Antti




More information about the MapServer-users mailing list