[OpenMap Users] layerHandler.turnLayerOn ?

From: Carsten Ø. Madsen <com_at_navicon.dk>
Date: Wed, 29 Feb 2012 15:03:32 +0100

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"]
Received on Wed Feb 29 2012 - 09:05:41 EST

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