Re: [OpenMap Users] layerHandler.turnLayerOn ?

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Thu, 1 Mar 2012 10:30:31 -0500

Hi Carsten,

Thanks for the update, that sounds like a refactoring leftover. I think it should work how you had hoped, just calling LayerHandler.turnLayerOn(boolean, layer) should be the only call you have to make.

- Don

On Mar 1, 2012, at 7:29 AM, Carsten Ø. Madsen wrote:

> 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"]

--
[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 - 10:31:57 EST

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