[Users] deactivate tickbox next to layer in tree when zoomed out over certain zoom level

Robert Buckley robertdbuckley at yahoo.com
Tue Nov 15 13:35:52 CET 2011


Hi,

I would like to disable the tickbox next to a layer when the user zooms out greater than zoom level 12. This will tell the user that the layer is deactivated.
At the moment I have the following code which simple sets the visibility , but when the zoom level is 11, the tick box is still white and can still be ticked on and off.


here is my code to set the visibility of the layer

map.events.on({ "zoomend": function (e) {
      if (this.getZoom() > 12) {
      layer_Flurbloeke.setVisibility(true);
      layer_Flurbloeke.icon='../images/add.png';
      layer_ertrag.setVisibility(true);  
      }
      else {
      layer_Flurbloeke.setVisibility(false);
      layer_ertrag.setVisibility(false);
      }
      }//end function (e)
    }); //end map.events.on 


Thanks for any help,

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20111115/9bb6415e/attachment.htm 


More information about the Users mailing list