Re: [OpenMap Users] layerHandler.turnLayerOn ?

From: Carsten Ø. Madsen <com_at_navicon.dk>
Date: Thu, 01 Mar 2012 13:29:07 +0100

For the record. Calling

layer.setVisible(layerVisible);

in the loop

and

layerHandler.setLayers(layerHandler.getLayers());

after the loop makes it work

/carsten

On 02/29/2012 03:03 PM, "Carsten Ø. Madsen" wrote:
> Hello
>
> I have a problem with controlling the visibility of layers.
>
> If I use layerHandler.turnLayerOn the layers renders correctly on the
> map but the bulbs in the OM LayersPanel does not render correctly. If
> I use layer.setVisible the bulbs renders correct but the layers that
> should be visible do not render anything?
>
> String tmp = config.getVisibleLayers();
> String[] visibleLayers = tmp != null ? tmp.split(" ")
> : new String[] {};
>
> for (Layer layer : layerHandler.getLayers()) {
> boolean layerVisible = false;
> for (String visibleLayerName : visibleLayers) {
> String prettyName = Environment.get(visibleLayerName
> + ".prettyName");
> if (layer.getName().equals(prettyName)) {
> layerVisible = true;
> break;
> }
> }
> layer.setVisible(layerVisible); // bulbs ok but
> nothing in layer
> // layerHandler.turnLayerOn(layerVisible, layer);
> bulbs wrong, layers ok
> }
>
> BR
> Carsten
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Mar 01 2012 - 07:30:01 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT