Class Layer<S extends Source>
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.layer.Layer<S>
- Type Parameters:
S
- source type
- All Implemented Interfaces:
HasBaseLayerOptions
,Serializable
- Direct Known Subclasses:
BaseImageLayer
,BaseTileLayer
,BaseVectorLayer
public abstract class Layer<S extends Source>
extends MapObservableObject
implements HasBaseLayerOptions
Base implementation of layer.
For more details see: layer docs
- See Also:
-
Nested Class Summary
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.MapObservableObject
children, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BaseLayerOptions
getId()
protected abstract BaseLayerOptions
abstract <T extends S>
Tvoid
setClassName
(String className) Set a CSS class name to the layer element.void
Sets the bounding extent for layer rendering.void
Sets layer's id.void
setMaxZoom
(Double maxZoom) Sets the maximum view zoom level (inclusive) at which layer will be visible.void
setMinZoom
(Double minZoom) Sets the minimum view zoom level (exclusive) above which layer will be visible.void
setOpacity
(Double opacity) Sets the opacity of the layer, allowed values range from 0 to 1.void
Sets source to the layer.void
setVisible
(Boolean visible) Set the visibility of the layer.void
Sets the z-index for layer rendering.withClassName
(String className) SeesetClassName(String)
.withExtent
(Extent extent) SeesetExtent(Extent)
.SeesetId(String)
.withMaxZoom
(Double maxZoom) SeesetMaxZoom(Double)
.withMinZoom
(Double minZoom) SeesetMinZoom(Double)
.withOpacity
(Double opacity) SeesetOpacity(Double)
.withSource
(S source) SeesetSource(Source)
.withVisible
(Boolean visible) SeesetVisible(Boolean)
.withZIndex
(Integer zIndex) SeesetZIndex(Integer)
.Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, getType, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, setParent, unmarkDirtyInDepth
-
Field Details
-
options
-
source
-
id
-
-
Constructor Details
-
Layer
public Layer()
-
-
Method Details
-
getId
- Returns:
- layer's id or
null
if not set
-
setId
Sets layer's id.- Parameters:
id
- id to set ornull
to unset value
-
withId
SeesetId(String)
.- Parameters:
id
- id to set ornull
to unset value- Returns:
- current instance
-
createOptions
-
getOptions
-
getSource
- Type Parameters:
T
- the source type- Returns:
- the layer source or
null
if not set
-
setSource
Sets source to the layer.For more details see: #setSource docs
- Parameters:
source
- source to set
-
withSource
SeesetSource(Source)
.- Parameters:
source
- source to set- Returns:
- current instance
-
getClassName
- Specified by:
getClassName
in interfaceHasBaseLayerOptions
- Returns:
- a CSS class name that should be used by the layer element,
null
value means that default value is used: 'ol-layer
'
-
setClassName
Description copied from interface:HasBaseLayerOptions
Set a CSS class name to the layer element. The default value 'ol-layer
'.Note, CSS class name is set only at creation time and cannot be changed at runtime.
For more details see: Layer docs
- Specified by:
setClassName
in interfaceHasBaseLayerOptions
- Parameters:
className
- CSS class name
-
withClassName
SeesetClassName(String)
.- Parameters:
className
- CSS class name- Returns:
- current instance
-
getOpacity
- Specified by:
getOpacity
in interfaceHasBaseLayerOptions
- Returns:
- the opacity of the layer.
null
value means that default value is used: '1
'
-
setOpacity
Description copied from interface:HasBaseLayerOptions
Sets the opacity of the layer, allowed values range from 0 to 1. The default value is '1
'.For more details see: setOpacity() docs
- Specified by:
setOpacity
in interfaceHasBaseLayerOptions
- Parameters:
opacity
- opacity of the layer
-
withOpacity
SeesetOpacity(Double)
.- Parameters:
opacity
- opacity of the layer- Returns:
- current instance
-
getVisible
- Specified by:
getVisible
in interfaceHasBaseLayerOptions
- Returns:
- the visibility of the layer.
null
value means that default value is used: 'true
'
-
setVisible
Description copied from interface:HasBaseLayerOptions
Set the visibility of the layer. The default value istrue
.For more details see: setVisible() docs
- Specified by:
setVisible
in interfaceHasBaseLayerOptions
- Parameters:
visible
- whether layer should be visible
-
withVisible
SeesetVisible(Boolean)
.- Parameters:
visible
- whether layer should be visible- Returns:
- current instance
-
getExtent
- Specified by:
getExtent
in interfaceHasBaseLayerOptions
- Returns:
- the bounding extent for layer rendering or
null
if not set
-
setExtent
Description copied from interface:HasBaseLayerOptions
Sets the bounding extent for layer rendering. The layer will not be rendered outside of this extent. If not set, the layer will be visible at all extents.For more details see: setExtent() docs
- Specified by:
setExtent
in interfaceHasBaseLayerOptions
- Parameters:
extent
- extent at which the layer is visible
-
withExtent
SeesetExtent(Extent)
.- Parameters:
extent
- extent at which the layer is visible- Returns:
- current instance
-
getZIndex
- Specified by:
getZIndex
in interfaceHasBaseLayerOptions
- Returns:
- z-index for layer rendering or
null
if not set
-
setZIndex
Description copied from interface:HasBaseLayerOptions
Sets the z-index for layer rendering.At rendering time, the layers will be ordered, first by Z-index and then by position. The default value is
0
.For more details see: setZIndex() docs
- Specified by:
setZIndex
in interfaceHasBaseLayerOptions
- Parameters:
zIndex
- z-index for layer rendering
-
withZIndex
SeesetZIndex(Integer)
.- Parameters:
zIndex
- z-index for layer rendering- Returns:
- current instance
-
getMinZoom
- Specified by:
getMinZoom
in interfaceHasBaseLayerOptions
- Returns:
- the minimum view zoom level (exclusive) above which layer will be visible or
null
if not set
-
setMinZoom
Description copied from interface:HasBaseLayerOptions
Sets the minimum view zoom level (exclusive) above which layer will be visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.For more details see: setMinZoom() docs
- Specified by:
setMinZoom
in interfaceHasBaseLayerOptions
- Parameters:
minZoom
- zoom level (exclusive) above which layer will be visible
-
withMinZoom
SeesetMinZoom(Double)
.- Parameters:
minZoom
- zoom level (exclusive) above which layer will be visible- Returns:
- current instance
-
getMaxZoom
- Specified by:
getMaxZoom
in interfaceHasBaseLayerOptions
- Returns:
- the maximum view zoom level (inclusive) at which layer will be visible or
null
if not set
-
setMaxZoom
Description copied from interface:HasBaseLayerOptions
Sets the maximum view zoom level (inclusive) at which layer will be visible. Note that the zoom levels for layer visibility are based on the view zoom level, which may be different from a tile source zoom level.For more details see: setMaxZoom() docs
- Specified by:
setMaxZoom
in interfaceHasBaseLayerOptions
- Parameters:
maxZoom
- zoom level (inclusive) at which layer will be visible
-
withMaxZoom
SeesetMaxZoom(Double)
.- Parameters:
maxZoom
- zoom level (inclusive) at which layer will be visible- Returns:
- current instance
-