You need to iterate over the map.layers array.

The number of layers: map.layers.length

Best regards,
Bart

On Tue, 3 Jun 2008 04:49:55 -0400, "Levii Smith" <[EMAIL PROTECTED]>
wrote:
> 
> 
> I need to have a custom layerswitcher [radio buttons, etc], and am
> having a hard time finding examples on modifying layer visibility or
> creating layers on the fly. So I have 2 questions. 
> 
> How do I determine the number of current layers? 
> 
> Given a layer I just created by clicking a checkbox (or one that
> already existed)...how do I grab the layer to modify visibility? 
> 
> OpenLayers.Layer.[layername].setVisibility(true); doesn't work since
> it says the layer doesn't exist. 
> 
> Thanks,
> Levii

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to