Class Marker
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.ui.marker.Marker
- All Implemented Interfaces:
Serializable,Evented,SupportsDragEvents,SupportsMouseEvents,Identifiable,LayerPopupFunctions,LayerTooltipFunctions,ExecutableFunctions,MarkerFunctions
L.Marker is used to display clickable/draggable icons on the map. Extends
InteractiveLayer.
- Since:
- 2020-02-06
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Nested Class Summary
Nested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAlt()Returns the text set for thealtattribute of the marker's icon, for accessibility purposes.Returns the padding kept between a dragged marker and the map borders that triggers auto-panning.intReturns the number of pixels the map is panned per animation frame during auto-panning.getIcon()Returns the icon used to render the marker.Returns the geographical point where the marker is placed.doubleReturns the opacity of the marker, between 0 and 1.intReturns the z-index offset applied to the marker when it rises on hover.getTitle()Returns the text shown in a native browser tooltip when hovering the marker.intReturns the offset applied to the z-index of the marker's icon, used to control its stacking order.booleanReturns whether the map is panned when a dragged marker is moved close to the map edges.booleanReturns whether the marker can be dragged with the mouse or touch.booleanReturns whether the marker can be focused and moved with the keyboard.booleanReturns whether the marker is brought to the front on hover.voidSets the text used for thealtattribute of the marker's icon, for accessibility purposes.voidsetAutoPan(boolean autoPan) Sets whether the map is panned when a dragged marker is moved close to the map edges.voidsetAutoPanPadding(Point autoPanPadding) Sets the padding kept between a dragged marker and the map borders that triggers auto-panning.voidsetAutoPanSpeed(int autoPanSpeed) Sets the number of pixels the map is panned per animation frame during auto-panning.voidsetDraggable(boolean draggable) Sets whether the marker can be dragged with the mouse or touch.voidSets the icon used to render the marker.voidsetKeyboard(boolean keyboard) Sets whether the marker can be focused and moved with the keyboard.voidChanges the marker position to the given point.voidsetOpacity(double opacity) Sets the opacity of the marker, between 0 and 1.voidsetRiseOffset(int riseOffset) Sets the z-index offset applied to the marker when it rises on hover.voidsetRiseOnHover(boolean riseOnHover) Sets whether the marker is brought to the front on hover.voidSets the text shown in a native browser tooltip when hovering the marker.voidsetZIndexOffset(int zIndexOffset) Sets the offset applied to the z-index of the marker's icon, used to control its stacking order.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.ui.marker.MarkerFunctions
callLatLngMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.events.supports.SupportsDragEvents
onDrag, onDragEnd, onDragStart, onMove, onMoveEnd, onMoveStartMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.layer.events.supports.SupportsMouseEvents
onClick, onContextMenuOpened, onDoubleClick, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp
-
Constructor Details
-
Marker
public Marker()Instantiates a new marker without a location and assigns it to themarkerPane. -
Marker
Instantiates a Marker object given a geographical point and optionally an options object.- Parameters:
latLng- the geographical point
-
-
Method Details
-
getLatLng
Returns the geographical point where the marker is placed.- Returns:
- the geographical point of the marker
-
setLatLng
Changes the marker position to the given point.- Specified by:
setLatLngin interfaceMarkerFunctions- Parameters:
latLng- the geographical point where the marker is placed
-
getTitle
Returns the text shown in a native browser tooltip when hovering the marker.- Returns:
- the title of the marker
-
setTitle
Sets the text shown in a native browser tooltip when hovering the marker.- Parameters:
title- the title of the marker
-
getOpacity
public double getOpacity()Returns the opacity of the marker, between 0 and 1.- Returns:
- the opacity of the marker
-
setOpacity
public void setOpacity(double opacity) Sets the opacity of the marker, between 0 and 1.- Specified by:
setOpacityin interfaceMarkerFunctions- Parameters:
opacity- the opacity of the marker
-
getIcon
Returns the icon used to render the marker.- Specified by:
getIconin interfaceMarkerFunctions- Returns:
- the icon of the marker
-
setIcon
Sets the icon used to render the marker.- Specified by:
setIconin interfaceMarkerFunctions- Parameters:
icon- the icon of the marker
-
isDraggable
public boolean isDraggable()Returns whether the marker can be dragged with the mouse or touch.- Returns:
trueif the marker is draggable,falseotherwise
-
setDraggable
public void setDraggable(boolean draggable) Sets whether the marker can be dragged with the mouse or touch.- Parameters:
draggable-trueto make the marker draggable,falseotherwise
-
isAutoPan
public boolean isAutoPan()Returns whether the map is panned when a dragged marker is moved close to the map edges.- Returns:
trueif the map auto-pans while dragging,falseotherwise
-
setAutoPan
public void setAutoPan(boolean autoPan) Sets whether the map is panned when a dragged marker is moved close to the map edges.- Parameters:
autoPan-trueto auto-pan the map while dragging,falseotherwise
-
getAutoPanSpeed
public int getAutoPanSpeed()Returns the number of pixels the map is panned per animation frame during auto-panning.- Returns:
- the auto-pan speed, in pixels per frame
-
setAutoPanSpeed
public void setAutoPanSpeed(int autoPanSpeed) Sets the number of pixels the map is panned per animation frame during auto-panning.- Parameters:
autoPanSpeed- the auto-pan speed, in pixels per frame
-
isKeyboard
public boolean isKeyboard()Returns whether the marker can be focused and moved with the keyboard.- Returns:
trueif the marker is keyboard-accessible,falseotherwise
-
setKeyboard
public void setKeyboard(boolean keyboard) Sets whether the marker can be focused and moved with the keyboard.- Parameters:
keyboard-trueto make the marker keyboard-accessible,falseotherwise
-
getZIndexOffset
public int getZIndexOffset()Returns the offset applied to the z-index of the marker's icon, used to control its stacking order.- Returns:
- the z-index offset of the marker
-
setZIndexOffset
public void setZIndexOffset(int zIndexOffset) Sets the offset applied to the z-index of the marker's icon, used to control its stacking order.- Specified by:
setZIndexOffsetin interfaceMarkerFunctions- Parameters:
zIndexOffset- the z-index offset of the marker
-
isRiseOnHover
public boolean isRiseOnHover()Returns whether the marker is brought to the front on hover.- Returns:
trueif the marker rises on hover,falseotherwise
-
setRiseOnHover
public void setRiseOnHover(boolean riseOnHover) Sets whether the marker is brought to the front on hover.- Parameters:
riseOnHover-trueto bring the marker to the front on hover,falseotherwise
-
getRiseOffset
public int getRiseOffset()Returns the z-index offset applied to the marker when it rises on hover.- Returns:
- the rise offset of the marker
-
setRiseOffset
public void setRiseOffset(int riseOffset) Sets the z-index offset applied to the marker when it rises on hover.- Parameters:
riseOffset- the rise offset of the marker
-
getAutoPanPadding
Returns the padding kept between a dragged marker and the map borders that triggers auto-panning.- Returns:
- the auto-pan padding, in pixels
-
setAutoPanPadding
Sets the padding kept between a dragged marker and the map borders that triggers auto-panning.- Parameters:
autoPanPadding- the auto-pan padding, in pixels
-
getAlt
Returns the text set for thealtattribute of the marker's icon, for accessibility purposes.- Returns:
- the alternative text of the marker
-
setAlt
Sets the text used for thealtattribute of the marker's icon, for accessibility purposes.- Parameters:
alt- the alternative text of the marker
-