You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am using the onOverlayRemove method to register a listener. Now I noticed that when the map loads and the layer was preselected to be active = true, then this method is called even though the layer is NOT being removed. Is this a bug?
I have got a PolygonMap where I override the on OverlayRemove method.
@OverRide
public void onOverlayRemove(LeafletOverlayRemoveEvent event)
{
for (Layer layer : layers.getOverlays())
{
if (layer.getCaption().equals(event.getName()))
{
layer.setActiveIndicator(false);
}
}
}
And I got Layers like this one, where I keep track wether the layer is active or not.
import org.vaadin.addon.leaflet.LWmsLayer;
public class LMTBLayer extends LWmsLayer implements Layer
{
private String name;
private boolean active;
Hi, I am using the onOverlayRemove method to register a listener. Now I noticed that when the map loads and the layer was preselected to be active = true, then this method is called even though the layer is NOT being removed. Is this a bug?
I have got a PolygonMap where I override the on OverlayRemove method.
@OverRide
public void onOverlayRemove(LeafletOverlayRemoveEvent event)
{
for (Layer layer : layers.getOverlays())
{
if (layer.getCaption().equals(event.getName()))
{
layer.setActiveIndicator(false);
}
}
}
And I got Layers like this one, where I keep track wether the layer is active or not.
import org.vaadin.addon.leaflet.LWmsLayer;
public class LMTBLayer extends LWmsLayer implements Layer
{
private String name;
private boolean active;
LMTBLayer(String geoserverURL)
{
setUrl(geoserverURL);
setLayers("werbeo:mtb");
setTransparent(true);
setFormat("image/png");
setActive(true);
setEnabled(true);
name = "MTB";
setCaption("Messtischblatt");
}
@OverRide
public boolean isActive()
{
return active;
}
@OverRide
public void setActive(boolean active)
{
setActiveIndicator(active);
super.setActive(active);
}
@OverRide
public void setActiveIndicator(boolean active)
{
this.active = active;
}
@OverRide
public boolean isActiveIndicator()
{
return active;
}
@OverRide
public String getName()
{
return name;
}
}
The text was updated successfully, but these errors were encountered: