Class VectorSource
- All Implemented Interfaces:
HasFeatureDrag
,HasFeatureModify
,HasFeatureSelect
,SourceFeatureClickNotifier
,AbstractVectorSource.HasOverlaps
,AbstractVectorSource.HasUseSpatialIndex
,AbstractVectorSource.HasVectorSourceOptions
,Source.HasAttributions
,Source.HasWrapX
,SupportsFeatureDrag
,SupportsFeatureModify
,SupportsFeatureSelect
,Serializable
VectorLayer
.
For more details see: VectorSource docs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
AbstractVectorSource.HasOverlaps, AbstractVectorSource.HasUseSpatialIndex, AbstractVectorSource.HasVectorSourceOptions
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
Nested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureDrag
HasFeatureDrag.AbstractSourceFeatureDragEvent, HasFeatureDrag.SourceFeatureDragEndEvent, HasFeatureDrag.SourceFeatureDragStartEvent
Nested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureModify
HasFeatureModify.AbstractSourceFeatureModifyEvent, HasFeatureModify.SourceFeatureDeleteEvent, HasFeatureModify.SourceFeatureModifyEndEvent, HasFeatureModify.SourceFeatureModifyStartEvent
Nested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureSelect
HasFeatureSelect.SourceFeatureSelectEvent
Nested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.SourceFeatureClickNotifier
SourceFeatureClickNotifier.AbstractFeatureClickEvent, SourceFeatureClickNotifier.SourceFeatureClickEvent, SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent, SourceFeatureClickNotifier.SourceFeatureSingleClickEvent
-
Field Summary
FieldsFields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractFeatureSource
features
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractEditableVectorSource
featureDragEnabled, featureModifyEnabled, featureSelectEnabled, jmixSourceFeatureDeleteRegistration, jmixSourceFeatureDragEndRegistration, jmixSourceFeatureDragStartRegistration, jmixSourceFeatureModifyEndRegistration, jmixSourceFeatureModifyStartRegistration, jmixSourceFeatureSelectionRegistration
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
overlaps, useSpatialIndex
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
attributions, attributionsCollapsible, id, projection, wrapX
Fields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, metaProperties, parent, removedChildren, syncId
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
Adds feature drag end listener.com.vaadin.flow.shared.Registration
Adds feature drag start listener.com.vaadin.flow.shared.Registration
addSourceFeatureClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureClickEvent> listener) Adds feature click listener.com.vaadin.flow.shared.Registration
Adds feature delete listener.com.vaadin.flow.shared.Registration
addSourceFeatureDoubleClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent> listener) Adds feature double click listener.com.vaadin.flow.shared.Registration
Adds feature modify end listener.com.vaadin.flow.shared.Registration
addSourceFeatureModifyStartListener
(Consumer<HasFeatureModify.SourceFeatureModifyStartEvent> listener) Adds feature modify start listener.com.vaadin.flow.shared.Registration
Adds feature select listener.com.vaadin.flow.shared.Registration
addSourceFeatureSingleClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureSingleClickEvent> listener) Adds feature single click listener.protected void
applyChangesToFeatures
(Map<Feature, SimpleGeometry<?>> features) void
Deselects all features in the source.void
deselectFeature
(Feature feature) Deselects the provided feature.void
deselectFeatures
(Collection<Feature> features) Deselects the collection of features.protected String
getType()
getWrapX()
boolean
isFeatureSelected
(Feature feature) Checks whether a feature is selected.protected void
protected void
protected void
protected void
protected void
protected void
void
Removes all features from the source.void
removeFeature
(Feature feature) Removes a feature from the source.void
Selects all features in the source.void
selectFeature
(Feature feature) Selects the provided feature.void
selectFeatures
(Collection<Feature> features) Selects the collection of features.void
setAttributions
(List<String> attributions) void
setFeatureDragEnabled
(Boolean enabled) Enables / disables feature drag mode.void
setFeatureModifyEnabled
(Boolean enabled) Enables / disables feature modify mode.void
setFeatureSelectEnabled
(Boolean enabled) Enables / disables feature select mode.void
setOverlaps
(Boolean overlaps) Sets whether source may have overlapping geometries.void
setUseSpatialIndex
(Boolean useSpatialIndex) Sets whether to use spatial index.void
Sets whether the source should be looped along the X coordinate.withAttributions
(List<String> attributions) withOverlaps
(Boolean overlaps) SeesetOverlaps(Boolean)
.withUseSpatialIndex
(Boolean useSpatialIndex) SeesetWrapX(Boolean)
.Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractFeatureSource
addAllFeatures, addFeature, getFeatures
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractEditableVectorSource
attachJmixSourceFeatureDeleteListener, attachJmixSourceFeatureDragEndListener, attachJmixSourceFeatureDragStartListener, attachJmixSourceFeatureModifyEndListener, attachJmixSourceFeatureModifyStartListener, attachJmixSourceFeatureSelectionListener
Methods inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
getAttributionsCollapsible, getId, getProjection, setAttributionsCollapsible, setId, setProjection
Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSuperParent, getSyncId, hashCode, isAttachedToMap, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMetaProperty, setParent, unmarkDirtyInDepth
-
Field Details
-
selectedFeatures
-
-
Constructor Details
-
VectorSource
public VectorSource()
-
-
Method Details
-
getType
- Specified by:
getType
in classMapObservableObject
-
removeFeature
Description copied from class:AbstractFeatureSource
Removes a feature from the source.- Overrides:
removeFeature
in classAbstractFeatureSource
- Parameters:
feature
- feature to remove
-
removeAllFeatures
public void removeAllFeatures()Description copied from class:AbstractFeatureSource
Removes all features from the source.- Overrides:
removeAllFeatures
in classAbstractFeatureSource
-
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
Sets whether the source should be looped along the X coordinate. The default value forSource
istrue
.Note, wrapX attribute is set only at creation time and cannot be changed at runtime. For more details see: VectorSource docs
- 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
-
getOverlaps
- Specified by:
getOverlaps
in interfaceAbstractVectorSource.HasOverlaps
- Overrides:
getOverlaps
in classAbstractVectorSource
- Returns:
- overlaps value or
null
if not set
-
setOverlaps
Sets whether source may have overlapping geometries. The default value istrue
.Setting this to
false
(e.g. for sources with polygons that represent administrative boundaries) allows the renderer to optimise fill and stroke operations.Note, overlaps attribute is set only at creation time and cannot be changed at runtime.
- Specified by:
setOverlaps
in interfaceAbstractVectorSource.HasOverlaps
- Overrides:
setOverlaps
in classAbstractVectorSource
- Parameters:
overlaps
- overlaps option
-
withOverlaps
SeesetOverlaps(Boolean)
.- Parameters:
overlaps
- overlaps option- Returns:
- current instance
-
getUseSpatialIndex
- Specified by:
getUseSpatialIndex
in interfaceAbstractVectorSource.HasUseSpatialIndex
- Overrides:
getUseSpatialIndex
in classAbstractVectorSource
- Returns:
- useSpatialIndex value or
null
if not set
-
setUseSpatialIndex
Sets whether to use spatial index. When features are removed and added frequently, and the total number of features is low, setting this tofalse
may improve performance. The default value istrue
.- Specified by:
setUseSpatialIndex
in interfaceAbstractVectorSource.HasUseSpatialIndex
- Overrides:
setUseSpatialIndex
in classAbstractVectorSource
- Parameters:
useSpatialIndex
- whether to use spatial index
-
withUseSpatialIndex
- Parameters:
useSpatialIndex
- whether to use spatial index- Returns:
- current instance
-
isFeatureSelected
Description copied from interface:HasFeatureSelect
Checks whether a feature is selected.- Specified by:
isFeatureSelected
in interfaceHasFeatureSelect
- Parameters:
feature
- feature to check- Returns:
true
if feature is selected
-
getSelectedFeatures
- Specified by:
getSelectedFeatures
in interfaceHasFeatureSelect
- Returns:
- unmodifiable collection of selected feature
-
selectFeature
Description copied from interface:HasFeatureSelect
Selects the provided feature.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
selectFeature
in interfaceHasFeatureSelect
- Parameters:
feature
- feature to select
-
deselectFeature
Description copied from interface:HasFeatureSelect
Deselects the provided feature.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
deselectFeature
in interfaceHasFeatureSelect
- Parameters:
feature
- feature to deselect
-
selectFeatures
Description copied from interface:HasFeatureSelect
Selects the collection of features.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
selectFeatures
in interfaceHasFeatureSelect
- Parameters:
features
- feature to select
-
deselectFeatures
Description copied from interface:HasFeatureSelect
Deselects the collection of features.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
deselectFeatures
in interfaceHasFeatureSelect
- Parameters:
features
- features to deselect
-
selectAllFeatures
public void selectAllFeatures()Description copied from interface:HasFeatureSelect
Selects all features in the source.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
selectAllFeatures
in interfaceHasFeatureSelect
-
deselectAllFeatures
public void deselectAllFeatures()Description copied from interface:HasFeatureSelect
Deselects all features in the source.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()
is enabled.- Specified by:
deselectAllFeatures
in interfaceHasFeatureSelect
-
getFeatureSelectEnabled
- Specified by:
getFeatureSelectEnabled
in interfaceSupportsFeatureSelect
- Overrides:
getFeatureSelectEnabled
in classAbstractEditableVectorSource
- Returns:
- whether select mode is enabled or not
-
setFeatureSelectEnabled
Description copied from interface:SupportsFeatureSelect
Enables / disables feature select mode.The default value is
false
.- Specified by:
setFeatureSelectEnabled
in interfaceSupportsFeatureSelect
- Overrides:
setFeatureSelectEnabled
in classAbstractEditableVectorSource
- Parameters:
enabled
- whether to enable select mode
-
getFeatureDragEnabled
- Specified by:
getFeatureDragEnabled
in interfaceSupportsFeatureDrag
- Overrides:
getFeatureDragEnabled
in classAbstractEditableVectorSource
- Returns:
- whether drag mode is enabled or not
-
setFeatureDragEnabled
Description copied from interface:SupportsFeatureDrag
Enables / disables feature drag mode.The default value is
false
.- Specified by:
setFeatureDragEnabled
in interfaceSupportsFeatureDrag
- Overrides:
setFeatureDragEnabled
in classAbstractEditableVectorSource
- Parameters:
enabled
- whether to enable drag mode
-
getFeatureModifyEnabled
- Specified by:
getFeatureModifyEnabled
in interfaceSupportsFeatureModify
- Overrides:
getFeatureModifyEnabled
in classAbstractEditableVectorSource
- Returns:
- whether modify mode is enabled or not
-
setFeatureModifyEnabled
Description copied from interface:SupportsFeatureModify
Enables / disables feature modify mode.The default value is
false
.- Specified by:
setFeatureModifyEnabled
in interfaceSupportsFeatureModify
- Overrides:
setFeatureModifyEnabled
in classAbstractEditableVectorSource
- Parameters:
enabled
- whether to enable modify mode
-
addSourceFeatureClickListener
public com.vaadin.flow.shared.Registration addSourceFeatureClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureClickEvent> listener) Adds feature click listener. Note, if the user makes double click on a feature, theSourceFeatureClickNotifier.SourceFeatureClickEvent
will be fired twice.- Specified by:
addSourceFeatureClickListener
in interfaceSourceFeatureClickNotifier
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureSingleClickListener
public com.vaadin.flow.shared.Registration addSourceFeatureSingleClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureSingleClickEvent> listener) Adds feature single click listener. Single click means that an event won't be fired if the user makes double click.- Specified by:
addSourceFeatureSingleClickListener
in interfaceSourceFeatureClickNotifier
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureDoubleClickListener
public com.vaadin.flow.shared.Registration addSourceFeatureDoubleClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent> listener) Adds feature double click listener.- Specified by:
addSourceFeatureDoubleClickListener
in interfaceSourceFeatureClickNotifier
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureSelectListener
public com.vaadin.flow.shared.Registration addSourceFeatureSelectListener(Consumer<HasFeatureSelect.SourceFeatureSelectEvent> listener) Description copied from interface:HasFeatureSelect
Adds feature select listener.- Specified by:
addSourceFeatureSelectListener
in interfaceHasFeatureSelect
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addFeatureDragStartListener
public com.vaadin.flow.shared.Registration addFeatureDragStartListener(Consumer<HasFeatureDrag.SourceFeatureDragStartEvent> listener) Description copied from interface:HasFeatureDrag
Adds feature drag start listener.- Specified by:
addFeatureDragStartListener
in interfaceHasFeatureDrag
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addFeatureDragEndListener
public com.vaadin.flow.shared.Registration addFeatureDragEndListener(Consumer<HasFeatureDrag.SourceFeatureDragEndEvent> listener) Description copied from interface:HasFeatureDrag
Adds feature drag end listener.- Specified by:
addFeatureDragEndListener
in interfaceHasFeatureDrag
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureModifyStartListener
public com.vaadin.flow.shared.Registration addSourceFeatureModifyStartListener(Consumer<HasFeatureModify.SourceFeatureModifyStartEvent> listener) Description copied from interface:HasFeatureModify
Adds feature modify start listener.- Specified by:
addSourceFeatureModifyStartListener
in interfaceHasFeatureModify
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureModifyEndListener
public com.vaadin.flow.shared.Registration addSourceFeatureModifyEndListener(Consumer<HasFeatureModify.SourceFeatureModifyEndEvent> listener) Description copied from interface:HasFeatureModify
Adds feature modify end listener.- Specified by:
addSourceFeatureModifyEndListener
in interfaceHasFeatureModify
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
addSourceFeatureDeleteListener
public com.vaadin.flow.shared.Registration addSourceFeatureDeleteListener(Consumer<HasFeatureModify.SourceFeatureDeleteEvent> listener) Description copied from interface:HasFeatureModify
Adds feature delete listener.- Specified by:
addSourceFeatureDeleteListener
in interfaceHasFeatureModify
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener
-
onJmixSourceFeatureSelection
- Overrides:
onJmixSourceFeatureSelection
in classAbstractEditableVectorSource
-
onJmixSourceFeatureDragStart
- Overrides:
onJmixSourceFeatureDragStart
in classAbstractEditableVectorSource
-
onJmixSourceFeatureDragEnd
- Overrides:
onJmixSourceFeatureDragEnd
in classAbstractEditableVectorSource
-
onJmixSourceFeatureModifyStart
- Overrides:
onJmixSourceFeatureModifyStart
in classAbstractEditableVectorSource
-
onJmixSourceFeatureModifyEnd
- Overrides:
onJmixSourceFeatureModifyEnd
in classAbstractEditableVectorSource
-
onJmixSourceFeatureDelete
- Overrides:
onJmixSourceFeatureDelete
in classAbstractEditableVectorSource
-
applyChangesToFeatures
-