Search in sources :

Example 1 with ImageOverlayOptions

use of org.peimari.gleaflet.client.ImageOverlayOptions 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);
}
Also used : URLReference(com.vaadin.shared.communication.URLReference) ImageOverlayOptions(org.peimari.gleaflet.client.ImageOverlayOptions) LatLngBounds(org.peimari.gleaflet.client.LatLngBounds)

Aggregations

URLReference (com.vaadin.shared.communication.URLReference)1 ImageOverlayOptions (org.peimari.gleaflet.client.ImageOverlayOptions)1 LatLngBounds (org.peimari.gleaflet.client.LatLngBounds)1