code: private void init() {
  		view.setLayerTitle(layer.getTitle());
  		view.setLayerVisible(layer.isMarkedAsVisible());
  
  		updateVisibilityToggle();
  
  		mapPresenter.getEventBus().addViewPortChangedHandler(new ViewPortChangedHandler() {
  			@Override
  			public void onViewPortChanged(ViewPortChangedEvent event) {
  				updateVisibilityToggle();
  			}
  		});
  
  		// React to layer visibility events:
  		mapPresenter.getEventBus().addLayerVisibilityHandler(new LayerVisibilityHandler() {
  
  			@Override
  			public void onShow(LayerShowEvent event) {
  			}
  
  			@Override
  			public void onHide(LayerHideEvent event) {
  			}
  
  			@Override
  			public void onVisibilityMarked(LayerVisibilityMarkedEvent event) {
  				view.setLayerVisible(layer.isMarkedAsVisible());
  
  			}
  		}, this.layer);
  	}
docs: ------------------------------------------------------------------------