use of org.peimari.gleaflet.client.LatLngBounds in project v-leaflet by mstahv.
the class LeafletImageOverlayConnector method update.
@Override
protected void update() {
if (imageOverlay != null) {
removeLayerFromParent();
}
LatLngBounds bounds = LatLngBounds.create(LatLng.create(getState().bounds.getSouthWestLat(), getState().bounds.getSouthWestLon()), LatLng.create(getState().bounds.getNorthEastLat(), getState().bounds.getNorthEastLon()));
URLReference urlReference = getState().resources.get("url");
ImageOverlayOptions options = createOptions();
if (getState().attribution != null) {
options.setAttribution(getState().attribution);
}
if (getState().opacity != null) {
options.setOpacity(getState().opacity);
}
String url = getConnection().translateVaadinUri(urlReference.getURL());
imageOverlay = ImageOverlay.create(url, bounds, options);
addToParent(imageOverlay);
}
Aggregations