Class VectorLayer
- All Implemented Interfaces:
BaseVectorLayer.HasBackground
,BaseVectorLayer.HasBaseVectorLayerOptions
,BaseVectorLayer.HasDeclutter
,BaseVectorLayer.HasRenderBuffer
,BaseVectorLayer.HasUpdateWhileAnimating
,BaseVectorLayer.HasUpdateWhileInteracting
,HasStyles
,HasBaseLayerOptions
,Serializable
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
For more details see: VectorLayer docs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.layer.BaseVectorLayer
BaseVectorLayer.HasBackground, BaseVectorLayer.HasBaseVectorLayerOptions, BaseVectorLayer.HasDeclutter, BaseVectorLayer.HasRenderBuffer, BaseVectorLayer.HasUpdateWhileAnimating, BaseVectorLayer.HasUpdateWhileInteracting
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContext
Fields inherited from class io.jmix.mapsflowui.kit.component.model.layer.BaseVectorLayer
styles
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 TypeMethodDescriptionvoid
Adds styles that should be merged with default.protected VectorLayerOptions
<S extends AbstractVectorSource>
Sprotected String
getType()
void
Clears list of styles.void
removeStyles
(Style... styles) Removes provided styles from layer.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setBackground
(String color) Sets the background color for the layer.void
setDeclutter
(Boolean declutter) Sets whether declutter images and texts.void
setRenderBuffer
(Double renderBuffer) Sets the buffer in pixels around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection.void
setSource
(AbstractVectorSource source) Sets source to the layer.void
setUpdateWhileAnimating
(Boolean updateWhileAnimating) Sets whether feature batches will be recreated during animations.void
setUpdateWhileInteracting
(Boolean updateWhileInteracting) Sets whether feature batches will be recreated during interactions.withBackground
(String color) withClassName
(String className) withDeclutter
(Boolean declutter) withExtent
(Extent extent) SeeLayer.setId(String)
.withMaxZoom
(Double maxZoom) withMinZoom
(Double minZoom) withOpacity
(Double opacity) withRenderBuffer
(Double renderBuffer) withSource
(AbstractVectorSource source) withStyles
(Style... styles) SeeaddStyles(Style...)
.withUpdateWhileAnimating
(Boolean updateWhileAnimating) withUpdateWhileInteracting
(Boolean updateWhileInteracting) withVisible
(Boolean visible) withZIndex
(Integer zIndex) Methods inherited from class io.jmix.mapsflowui.kit.component.model.layer.BaseVectorLayer
getOptions
Methods inherited from class io.jmix.mapsflowui.kit.component.model.layer.Layer
getClassName, getExtent, getId, getMaxZoom, getMinZoom, getOpacity, getVisible, getZIndex, setClassName, setExtent, setId, setMaxZoom, setMinZoom, setOpacity, setVisible, setZIndex
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, setParent, unmarkDirtyInDepth
-
Field Details
-
applicationContext
protected org.springframework.context.ApplicationContext applicationContext
-
-
Constructor Details
-
VectorLayer
public VectorLayer()
-
-
Method Details
-
createOptions
- Specified by:
createOptions
in classLayer<AbstractVectorSource>
-
getType
- Specified by:
getType
in classMapObservableObject
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
withId
Description copied from class:Layer
SeeLayer.setId(String)
.- Overrides:
withId
in classLayer<AbstractVectorSource>
- Parameters:
id
- id to set ornull
to unset value- Returns:
- current instance
-
getSource
- Specified by:
getSource
in classLayer<AbstractVectorSource>
- Type Parameters:
S
- the source type- Returns:
- the layer source or
null
if not set
-
setSource
Sets source to the layer.For more details see: #setSource docs
The following sources supported:
- Overrides:
setSource
in classLayer<AbstractVectorSource>
- Parameters:
source
- source to set
-
withSource
- Overrides:
withSource
in classLayer<AbstractVectorSource>
- Parameters:
source
- source to set- Returns:
- current instance
-
getRenderBuffer
- Specified by:
getRenderBuffer
in interfaceBaseVectorLayer.HasRenderBuffer
- Overrides:
getRenderBuffer
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- the render buffer in pixels,
null
value means that default value is used:100
-
setRenderBuffer
Description copied from interface:BaseVectorLayer.HasRenderBuffer
Sets the buffer in pixels around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. The hit detection only checks features that are within a certain distance of the given position. For large icons, the actual geometry of a feature might be too far away and is not considered. Recommended value: the size of the largest symbol, line width or label.Note, render buffer is set only at creation time and cannot be changed at runtime.
For more details see: BaseVectorLayer docs
- Specified by:
setRenderBuffer
in interfaceBaseVectorLayer.HasRenderBuffer
- Overrides:
setRenderBuffer
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
renderBuffer
- the buffer in pixels
-
withRenderBuffer
- Parameters:
renderBuffer
-- Returns:
- current instance
-
getDeclutter
- Specified by:
getDeclutter
in interfaceBaseVectorLayer.HasDeclutter
- Overrides:
getDeclutter
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- whether declutter images and texts,
null
value means that default value is used:false
-
setDeclutter
Description copied from interface:BaseVectorLayer.HasDeclutter
Sets whether declutter images and texts. Decluttering is applied to all image and text styles of all vector layers that have set this totrue
. The priority is defined by the z-index of the layer, theStyle.withZIndex(Integer)
of the style and the render order of features. Higher z-index means higher priority. Within the same z-index, a feature rendered before another has higher priority.As an optimization decluttered features from layers with the same
Layer.setClassName(String)
are rendered above theFill
andStroke
styles of all of those layers regardless of z-index. To opt out of this behavior and place declutterd features with their own layer configure the layer with a className other than 'ol-layer
'.The default value is
false
.Note, declutter is set only at creation time and cannot be changed at runtime.
For more details see: BaseVectorLayer docs
- Specified by:
setDeclutter
in interfaceBaseVectorLayer.HasDeclutter
- Overrides:
setDeclutter
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
declutter
- whether declutter images and texts
-
withDeclutter
- Parameters:
declutter
-- Returns:
- current instance
-
getBackground
- Specified by:
getBackground
in interfaceBaseVectorLayer.HasBackground
- Overrides:
getBackground
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- background color for the layer or
null
if not set
-
setBackground
Description copied from interface:BaseVectorLayer.HasBackground
Sets the background color for the layer. If not specified, no background will be rendered.Note, background color is set only at creation time and cannot be changed at runtime.
For more details see: BaseVectorLayer docs
- Specified by:
setBackground
in interfaceBaseVectorLayer.HasBackground
- Overrides:
setBackground
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
color
- color to set
-
withBackground
- Parameters:
color
-- Returns:
- current instance
-
getUpdateWhileAnimating
- Specified by:
getUpdateWhileAnimating
in interfaceBaseVectorLayer.HasUpdateWhileAnimating
- Overrides:
getUpdateWhileAnimating
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- whether feature batches will be recreated during animations,
null
value means that default value is used:false
-
setUpdateWhileAnimating
Description copied from interface:BaseVectorLayer.HasUpdateWhileAnimating
Sets whether feature batches will be recreated during animations. This means that no vectors will be shown clipped, but the setting will have a performance impact for large amounts of vector data. When set tofalse
, batches will be recreated when no animation is active.The default value is
false
.Note, "updateWhileAnimating" is set only at creation time and cannot be changed at runtime. For more details see: BaseVectorLayer docs
- Specified by:
setUpdateWhileAnimating
in interfaceBaseVectorLayer.HasUpdateWhileAnimating
- Overrides:
setUpdateWhileAnimating
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
updateWhileAnimating
- whether feature batches will be recreated during animations
-
withUpdateWhileAnimating
- Parameters:
updateWhileAnimating
-- Returns:
-
getUpdateWhileInteracting
- Specified by:
getUpdateWhileInteracting
in interfaceBaseVectorLayer.HasUpdateWhileInteracting
- Overrides:
getUpdateWhileInteracting
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- whether feature batches will be recreated during interactions,
null
value means that default value is used:false
-
setUpdateWhileInteracting
Description copied from interface:BaseVectorLayer.HasUpdateWhileInteracting
Sets whether feature batches will be recreated during interactions. The default value isfalse
.For instance, if the user moves map by mouse, the features that were not visible will be drawn after the user releases the pressed mouse. To enable always drawing features, set property to
true
.Note, "updateWhileInteracting" is set only at creation time and cannot be changed at runtime.
For more details see: BaseVectorLayer docs
- Specified by:
setUpdateWhileInteracting
in interfaceBaseVectorLayer.HasUpdateWhileInteracting
- Overrides:
setUpdateWhileInteracting
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
updateWhileInteracting
- whether feature batches will be recreated during interactions
-
withUpdateWhileInteracting
- Parameters:
updateWhileInteracting
-- Returns:
- current instance
-
withClassName
Description copied from class:Layer
- Overrides:
withClassName
in classLayer<AbstractVectorSource>
- Parameters:
className
- CSS class name- Returns:
- current instance
-
withOpacity
Description copied from class:Layer
- Overrides:
withOpacity
in classLayer<AbstractVectorSource>
- Parameters:
opacity
- opacity of the layer- Returns:
- current instance
-
withVisible
Description copied from class:Layer
- Overrides:
withVisible
in classLayer<AbstractVectorSource>
- Parameters:
visible
- whether layer should be visible- Returns:
- current instance
-
withExtent
Description copied from class:Layer
- Overrides:
withExtent
in classLayer<AbstractVectorSource>
- Parameters:
extent
- extent at which the layer is visible- Returns:
- current instance
-
withZIndex
Description copied from class:Layer
- Overrides:
withZIndex
in classLayer<AbstractVectorSource>
- Parameters:
zIndex
- z-index for layer rendering- Returns:
- current instance
-
withMinZoom
Description copied from class:Layer
- Overrides:
withMinZoom
in classLayer<AbstractVectorSource>
- Parameters:
minZoom
- zoom level (exclusive) above which layer will be visible- Returns:
- current instance
-
withMaxZoom
Description copied from class:Layer
- Overrides:
withMaxZoom
in classLayer<AbstractVectorSource>
- Parameters:
maxZoom
- zoom level (inclusive) at which layer will be visible- Returns:
- current instance
-
addStyles
Description copied from class:BaseVectorLayer
Adds styles that should be merged with default. Layer's styles are applied for all added features, except features with own style.- Specified by:
addStyles
in interfaceHasStyles
- Overrides:
addStyles
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
styles
- styles to add
-
withStyles
SeeaddStyles(Style...)
.- Parameters:
styles
- styles to add- Returns:
- current instance
-
getStyles
- Specified by:
getStyles
in interfaceHasStyles
- Overrides:
getStyles
in classBaseVectorLayer<AbstractVectorSource>
- Returns:
- layer's styles or empty list
-
removeStyles
Description copied from class:BaseVectorLayer
Removes provided styles from layer.- Specified by:
removeStyles
in interfaceHasStyles
- Overrides:
removeStyles
in classBaseVectorLayer<AbstractVectorSource>
- Parameters:
styles
- styles to remove
-
removeAllStyles
public void removeAllStyles()Description copied from class:BaseVectorLayer
Clears list of styles.- Specified by:
removeAllStyles
in interfaceHasStyles
- Overrides:
removeAllStyles
in classBaseVectorLayer<AbstractVectorSource>
-