Class TileLayer
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.LeafletObject
org.vaadin.addons.componentfactory.leaflet.layer.Layer
org.vaadin.addons.componentfactory.leaflet.layer.groups.GridLayer
org.vaadin.addons.componentfactory.leaflet.layer.raster.TileLayer
- All Implemented Interfaces:
Serializable,Evented,Identifiable,LayerPopupFunctions,LayerTooltipFunctions,ExecutableFunctions
Used to load and display tile layers on the map. Note that most tile servers
require attribution, which you can set under Layer. Extends GridLayer.
- Since:
- 2020-03-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.groups.GridLayer
GridLayer.EventsNested 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 TypeMethodDescriptionReturns the crossOrigin attribute value applied to the tiles.Returns the URL of the tile image shown in place of tiles that fail to load.String[]Returns the subdomains of the tile service.Returns the URL template of this tile layer.intReturns the offset applied to the zoom number used in tile URLs.booleanReturns whether retina displays are detected to request higher resolution tiles.booleanisTms()Returns whether the Y axis numbering for tiles is inverted (TMS services).booleanReturns whether the zoom number used in tile URLs is reversed.voidsetCrossOrigin(String crossOrigin) Whether the crossOrigin attribute will be added to the tiles.voidsetDetectRetina(boolean detectRetina) If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.voidsetErrorTileUrl(String errorTileUrl) URL to the tile image to show in place of the tile that failed to load.voidsetSubdomains(String... subdomains) Subdomains of the tile service.voidsetTms(boolean tms) If true, inverses Y axis numbering for tiles (turn this on for TMS services).voidsetZoomOffset(int zoomOffset) The zoom number used in tile URLs will be offset with this value.voidsetZoomReverse(boolean zoomReverse) If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)Methods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.groups.GridLayer
getBounds, getClassName, getKeepBuffer, getMaxZoom, getMinZoom, getOpacity, getTileSize, getUpdateInterval, getzIndex, isNoWrap, isUpdateWhenIdle, isUpdateWhenZooming, onLoad, onLoading, onTileError, onTileLoad, onTileLoadStart, onTileUnload, setBounds, setClassName, setKeepBuffer, setMaxZoom, setMinZoom, setNoWrap, setOpacity, setTileSize, setUpdateInterval, setUpdateWhenIdle, setUpdateWhenZooming, setzIndexMethods 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
listens, off, off, onMethods 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, toggleTooltip
-
Constructor Details
-
TileLayer
Instantiates a tile layer object given a URL template and optionally an options object.- Parameters:
urlTemplate- the URL template of this tile layer
-
-
Method Details
-
getSubdomains
Returns the subdomains of the tile service.- Returns:
- the subdomains
-
setSubdomains
Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.- Parameters:
subdomains- the subdomains to set
-
getErrorTileUrl
Returns the URL of the tile image shown in place of tiles that fail to load.- Returns:
- the errorTileUrl
-
setErrorTileUrl
URL to the tile image to show in place of the tile that failed to load.- Parameters:
errorTileUrl- the errorTileUrl to set
-
getZoomOffset
public int getZoomOffset()Returns the offset applied to the zoom number used in tile URLs.- Returns:
- the zoomOffset
-
setZoomOffset
public void setZoomOffset(int zoomOffset) The zoom number used in tile URLs will be offset with this value.- Parameters:
zoomOffset- the zoomOffset to set
-
isTms
public boolean isTms()Returns whether the Y axis numbering for tiles is inverted (TMS services).- Returns:
- the tms
-
setTms
public void setTms(boolean tms) If true, inverses Y axis numbering for tiles (turn this on for TMS services).- Parameters:
tms- the tms to set
-
isZoomReverse
public boolean isZoomReverse()Returns whether the zoom number used in tile URLs is reversed.- Returns:
- the zoomReverse
-
setZoomReverse
public void setZoomReverse(boolean zoomReverse) If set to true, the zoom number used in tile URLs will be reversed (maxZoom - zoom instead of zoom)- Parameters:
zoomReverse- the zoomReverse to set
-
isDetectRetina
public boolean isDetectRetina()Returns whether retina displays are detected to request higher resolution tiles.- Returns:
- the detectRetina
-
setDetectRetina
public void setDetectRetina(boolean detectRetina) If true and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.- Parameters:
detectRetina- the detectRetina to set
-
getCrossOrigin
Returns the crossOrigin attribute value applied to the tiles.- Returns:
- the crossOrigin
-
setCrossOrigin
Whether the crossOrigin attribute will be added to the tiles. If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data. Refer to CORS Settings for valid String values.- Parameters:
crossOrigin- the crossOrigin to set
-
getUrlTemplate
Returns the URL template of this tile layer.- Returns:
- the urlTemplate
-