Class OsmSource
java.lang.Object
- All Implemented Interfaces:
AbstractXyzSource.HasMaxZoom
,HasCrossOrigin
,HasUrl
,Source.HasAttributions
,Source.HasWrapX
,TileSource.HasCacheSize
,TileSource.HasOpaque
,Serializable
public class OsmSource
extends AbstractXyzSource
implements Source.HasAttributions, TileSource.HasCacheSize, HasCrossOrigin, AbstractXyzSource.HasMaxZoom, TileSource.HasOpaque, HasUrl, Source.HasWrapX
Source for the loading tiles from an OpenStreetMap tile server. It can be used in
TileLayer
.
For more details see OSM docs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractXyzSource
AbstractXyzSource.HasMaxZoom, AbstractXyzSource.HasMinZoom, AbstractXyzSource.HasTileSize, AbstractXyzSource.HasXyzSourceOptions
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.UrlTileSource
UrlTileSource.HasUrls, UrlTileSource.HasUrlTileSourceOptions
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.TileSource
TileSource.HasCacheSize, TileSource.HasOpaque, TileSource.HasTileSourceOptions
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
Source.HasAttributions, Source.HasAttributionsCollapsible, Source.HasProjection, Source.HasSourceOptions, Source.HasWrapX
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent
-
Field Summary
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractXyzSource
gutter, maxZoom, minZoom, tileSize
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.TileImageSource
crossOrigin
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.UrlTileSource
url, urls
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.TileSource
cacheSize, opaque
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
attributions, attributionsCollapsible, projection, wrapX
Fields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getType()
getUrl()
getWrapX()
void
setAttributions
(List<String> attributions) void
setCacheSize
(Integer cacheSize) void
setCrossOrigin
(String crossOrigin) Sets the crossOrigin attribute for loaded images.void
setMaxZoom
(Integer maxZoom) void
Sets whether the layer is opaque.void
Sets the URL template.void
withAttributions
(List<String> attributions) withCacheSize
(Integer cacheSize) withCrossOrigin
(String crossOrigin) withMaxZoom
(Integer maxZoom) SeesetMaxZoom(Integer)
.withOpaque
(Boolean opaque) SeesetOpaque(Boolean)
.SeesetUrl(String)
.SeesetWrapX(Boolean)
.Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractXyzSource
getGutter, getMinZoom, getTileSize, setGutter, setMinZoom, setTileSize
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.UrlTileSource
getUrls, setUrls
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
getAttributionsCollapsible, getProjection, setAttributionsCollapsible, setProjection
Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, unmarkDirtyInDepth
-
Constructor Details
-
OsmSource
public OsmSource()
-
-
Method Details
-
getType
- Specified by:
getType
in classMapObservableObject
-
getAttributions
- Specified by:
getAttributions
in interfaceSource.HasAttributions
- Overrides:
getAttributions
in classSource
- Returns:
- the attributions of the source or
null
if not set
-
setAttributions
- Specified by:
setAttributions
in interfaceSource.HasAttributions
- Overrides:
setAttributions
in classSource
- Parameters:
attributions
- info about copyrights and licences
-
withAttributions
- Parameters:
attributions
- info about copyrights and licences- Returns:
- current instance
-
getWrapX
- Specified by:
getWrapX
in interfaceSource.HasWrapX
- Overrides:
getWrapX
in classSource
- Returns:
- whether the source should be looped along the X coordinate or
null
if not set
-
setWrapX
- Specified by:
setWrapX
in interfaceSource.HasWrapX
- Overrides:
setWrapX
in classSource
- Parameters:
wrapX
- whether the source should be looped along the X coordinate
-
withWrapX
SeesetWrapX(Boolean)
.- Parameters:
wrapX
- whether the source should be looped along the X coordinate- Returns:
- current instance
-
getMaxZoom
- Specified by:
getMaxZoom
in interfaceAbstractXyzSource.HasMaxZoom
- Overrides:
getMaxZoom
in classAbstractXyzSource
- Returns:
- max zoom level or
null
if not set
-
setMaxZoom
- Specified by:
setMaxZoom
in interfaceAbstractXyzSource.HasMaxZoom
- Overrides:
setMaxZoom
in classAbstractXyzSource
- Parameters:
maxZoom
- zoom to set
-
withMaxZoom
SeesetMaxZoom(Integer)
.- Parameters:
maxZoom
- zoom to set- Returns:
- current instance
-
getCrossOrigin
- Specified by:
getCrossOrigin
in interfaceHasCrossOrigin
- Overrides:
getCrossOrigin
in classTileImageSource
- Returns:
- cross-origin or
null
if not set
-
setCrossOrigin
Sets the crossOrigin attribute for loaded images.Note, crossOrigin is set only at creation time and cannot be changed at runtime.
For more details see: OSM docs
- Specified by:
setCrossOrigin
in interfaceHasCrossOrigin
- Overrides:
setCrossOrigin
in classTileImageSource
- Parameters:
crossOrigin
- cross-origin to set
-
withCrossOrigin
- Parameters:
crossOrigin
- cross-origin to set- Returns:
- current instance
-
getCacheSize
- Specified by:
getCacheSize
in interfaceTileSource.HasCacheSize
- Overrides:
getCacheSize
in classTileSource
- Returns:
- tile cache size or
null
if not set
-
setCacheSize
- Specified by:
setCacheSize
in interfaceTileSource.HasCacheSize
- Overrides:
setCacheSize
in classTileSource
- Parameters:
cacheSize
- the cache size to set
-
withCacheSize
- Parameters:
cacheSize
- the cache size to set- Returns:
- current instance
-
getOpaque
- Specified by:
getOpaque
in interfaceTileSource.HasOpaque
- Overrides:
getOpaque
in classTileSource
- Returns:
- whether the layer is opaque or
null
if not set
-
setOpaque
Sets whether the layer is opaque. The default value istrue
.Note, opaque attribute is set only at creation time and cannot be changed at runtime.
For more details see: OSM docs
- Specified by:
setOpaque
in interfaceTileSource.HasOpaque
- Overrides:
setOpaque
in classTileSource
- Parameters:
opaque
- opaque option
-
withOpaque
SeesetOpaque(Boolean)
.- Parameters:
opaque
- opaque option- Returns:
- current instance
-
getUrl
- Specified by:
getUrl
in interfaceHasUrl
- Overrides:
getUrl
in classUrlTileSource
- Returns:
- URL or
null
if not set
-
setUrl
Sets the URL template. Must include {x}, {y} or {-y}, and {z} placeholders. The default value ishttps://tile.openstreetmap.org/{z}/{x}/{y}.png
.For more details see OSM docs
- Specified by:
setUrl
in interfaceHasUrl
- Overrides:
setUrl
in classUrlTileSource
- Parameters:
url
- url template to set
-
withUrl
SeesetUrl(String)
.- Parameters:
url
- url template to set- Returns:
- current instance
-