Class ImageOverlay
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.LeafletObject
org.vaadin.addons.componentfactory.leaflet.layer.Layer
org.vaadin.addons.componentfactory.leaflet.layer.InteractiveLayer
org.vaadin.addons.componentfactory.leaflet.layer.raster.ImageOverlay
- All Implemented Interfaces:
Serializable,Evented,SupportsMouseEvents,Identifiable,LayerPopupFunctions,LayerTooltipFunctions,ExecutableFunctions
Used to load and display a single image over specific bounds of the map.
Extends InteractiveLayer.
- Since:
- 2020-03-06
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.vaadin.addons.componentfactory.leaflet.layer.Layer
Layer.LayerEventType -
Field Summary
Fields inherited from class org.vaadin.addons.componentfactory.leaflet.layer.Layer
DEFAULT_PANE -
Constructor Summary
ConstructorsConstructorDescriptionImageOverlay(String imageUrl) Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to. -
Method Summary
Modifier and TypeMethodDescriptiongetAlt()Gets the text used for the alt attribute of the image.Gets the geographical bounds the image is tied to.Gets the custom class name assigned to the image.Gets the crossOrigin attribute value applied to the image.Gets the URL of the image shown when the overlay image fails to load.Gets the URL of the image displayed by this overlay.doubleGets the opacity of the image overlay.intGets the explicit zIndex of the overlay layer.voidonError(LeafletEventListener<LeafletEvent> listener) Fired when the ImageOverlay layer fails to load its imagevoidonLoad(LeafletEventListener<LeafletEvent> listener) Fired when the ImageOverlay layer has loaded its imagevoidText for the alt attribute of the image (useful for accessibility).voidsetBounds(LatLngBounds bounds) Sets the geographical bounds the image is tied to.voidsetClassName(String className) A custom class name to assign to the image.voidsetCrossOrigin(String crossOrigin) Whether the crossOrigin attribute will be added to the image.voidsetErrorOverlayUrl(String errorOverlayUrl) URL to the overlay image to show in place of the overlay that failed to load.voidsetOpacity(double opacity) The opacity of the image overlay.voidsetzIndex(int zIndex) The explicit zIndex of the overlay layer.Methods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.InteractiveLayer
isBubblingMouseEvents, isInteractive, setBubblingMouseEvents, setInteractiveMethods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.Layer
addEventListener, addTo, addTo, bindPopup, bindPopup, bindTooltip, bindTooltip, clearAllEventListeners, fireEvent, getAttribution, getEvents, getPane, getPopup, getTooltip, hasEventListeners, onAdd, onPopupClose, onPopupOpen, onRemove, onTooltipClose, onTooltipOpen, remove, removeEventListener, set, setAttribution, setPane, unbindPopup, unbindTooltipMethods inherited from class org.vaadin.addons.componentfactory.leaflet.LeafletObject
call, configureObjectMapper, executeJs, getConstructorArgumentNames, getJson, getLeafletType, getParent, getUuid, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.events.Evented
addEventListener, clearAllEventListeners, hasEventListeners, listens, off, off, on, removeEventListenerMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.map.functions.ExecutableFunctions
call, call, executeJs, executeJsMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.Identifiable
getUuidMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.LayerPopupFunctions
closePopup, isPopupOpen, openPopup, openPopup, setPopupContent, setPopupContent, togglePopupMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.LayerTooltipFunctions
closeTooltip, isTooltipOpen, openTooltip, openTooltip, setTooltipContent, setTooltipContent, toggleTooltipMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.events.supports.SupportsMouseEvents
onClick, onContextMenuOpened, onDoubleClick, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp
-
Constructor Details
-
ImageOverlay
Instantiates an image overlay object given the URL of the image and the geographical bounds it is tied to.- Parameters:
imageUrl- the image url
-
-
Method Details
-
onLoad
Fired when the ImageOverlay layer has loaded its image- Parameters:
listener- the listener to call when the event occurs, notnull
-
onError
Fired when the ImageOverlay layer fails to load its image- Parameters:
listener- the listener to call when the event occurs, notnull
-
getImageUrl
Gets the URL of the image displayed by this overlay.- Returns:
- the imageUrl
-
getOpacity
public double getOpacity()Gets the opacity of the image overlay.- Returns:
- the opacity
-
setOpacity
public void setOpacity(double opacity) The opacity of the image overlay.- Parameters:
opacity- the opacity to set
-
getAlt
Gets the text used for the alt attribute of the image.- Returns:
- the alt
-
setAlt
Text for the alt attribute of the image (useful for accessibility).- Parameters:
alt- the alt to set
-
getCrossOrigin
Gets the crossOrigin attribute value applied to the image.- Returns:
- the crossOrigin
-
setCrossOrigin
Whether the crossOrigin attribute will be added to the image. If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data. Refer to CORS Settings for valid String values.- Parameters:
crossOrigin- the crossOrigin to set
-
getErrorOverlayUrl
Gets the URL of the image shown when the overlay image fails to load.- Returns:
- the errorOverlayUrl
-
setErrorOverlayUrl
URL to the overlay image to show in place of the overlay that failed to load.- Parameters:
errorOverlayUrl- the errorOverlayUrl to set
-
getzIndex
public int getzIndex()Gets the explicit zIndex of the overlay layer.- Returns:
- the zIndex
-
setzIndex
public void setzIndex(int zIndex) The explicit zIndex of the overlay layer.- Parameters:
zIndex- the zIndex to set
-
getClassName
Gets the custom class name assigned to the image.- Returns:
- the className
-
setClassName
A custom class name to assign to the image. Empty by default.- Parameters:
className- the className to set
-
getBounds
Gets the geographical bounds the image is tied to.- Returns:
- the bounds
-
setBounds
Sets the geographical bounds the image is tied to.- Parameters:
bounds- the bounds to set
-