LayerTreeWithLegendInfo ltwli = WidgetInfoHelper.getClientWidgetInfo(LayerTreeWithLegendInfo.IDENTIFIER,
mapWidget);
setIconSize(ltwli == null ? DEFAULT_ICONSIZE : ltwli.getIconSize());
for (Layer<?> layer : mapModel.getLayers()) {
registrations.add(layer.addLayerChangedHandler(new LayerChangedHandler() {
public void onLabelChange(LayerLabeledEvent event) {
GWT.log("Legend: onLabelChange() - " + event.getLayer().getLabel());
// find the node & update the icon
for (TreeNode node : tree.getAllNodes()) {
if (node.getName().equals(event.getLayer().getLabel())) {