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.HasVectorSourceOptionsNested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
Source.HasAttributions, Source.HasAttributionsCollapsible, Source.HasProjection, Source.HasSourceOptions, Source.HasWrapXNested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEventNested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureDrag
HasFeatureDrag.AbstractSourceFeatureDragEvent, HasFeatureDrag.SourceFeatureDragEndEvent, HasFeatureDrag.SourceFeatureDragStartEventNested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureModify
HasFeatureModify.AbstractSourceFeatureModifyEvent, HasFeatureModify.SourceFeatureDeleteEvent, HasFeatureModify.SourceFeatureModifyEndEvent, HasFeatureModify.SourceFeatureModifyStartEventNested classes/interfaces inherited from interface io.jmix.mapsflowui.component.model.source.HasFeatureSelect
HasFeatureSelect.SourceFeatureSelectEventNested 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
featuresFields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractEditableVectorSource
featureDragEnabled, featureModifyEnabled, featureSelectEnabled, jmixSourceFeatureDeleteRegistration, jmixSourceFeatureDragEndRegistration, jmixSourceFeatureDragStartRegistration, jmixSourceFeatureModifyEndRegistration, jmixSourceFeatureModifyStartRegistration, jmixSourceFeatureSelectionRegistrationFields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
overlaps, useSpatialIndexFields inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
attributions, attributionsCollapsible, id, projection, wrapXFields 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.RegistrationAdds feature drag end listener.com.vaadin.flow.shared.RegistrationAdds feature drag start listener.com.vaadin.flow.shared.RegistrationaddSourceFeatureClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureClickEvent> listener) Adds feature click listener.com.vaadin.flow.shared.RegistrationAdds feature delete listener.com.vaadin.flow.shared.RegistrationaddSourceFeatureDoubleClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent> listener) Adds feature double click listener.com.vaadin.flow.shared.RegistrationAdds feature modify end listener.com.vaadin.flow.shared.RegistrationaddSourceFeatureModifyStartListener(Consumer<HasFeatureModify.SourceFeatureModifyStartEvent> listener) Adds feature modify start listener.com.vaadin.flow.shared.RegistrationAdds feature select listener.com.vaadin.flow.shared.RegistrationaddSourceFeatureSingleClickListener(Consumer<SourceFeatureClickNotifier.SourceFeatureSingleClickEvent> listener) Adds feature single click listener.protected voidapplyChangesToFeatures(Map<Feature, SimpleGeometry<?>> features) voidDeselects all features in the source.voiddeselectFeature(Feature feature) Deselects the provided feature.voiddeselectFeatures(Collection<Feature> features) Deselects the collection of features.protected StringgetType()getWrapX()booleanisFeatureSelected(Feature feature) Checks whether a feature is selected.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidvoidRemoves all features from the source.voidremoveFeature(Feature feature) Removes a feature from the source.voidSelects all features in the source.voidselectFeature(Feature feature) Selects the provided feature.voidselectFeatures(Collection<Feature> features) Selects the collection of features.voidsetAttributions(List<String> attributions) voidsetFeatureDragEnabled(Boolean enabled) Enables / disables feature drag mode.voidsetFeatureModifyEnabled(Boolean enabled) Enables / disables feature modify mode.voidsetFeatureSelectEnabled(Boolean enabled) Enables / disables feature select mode.voidsetOverlaps(Boolean overlaps) Sets whether source may have overlapping geometries.voidsetUseSpatialIndex(Boolean useSpatialIndex) Sets whether to use spatial index.voidSets 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, getFeaturesMethods inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractEditableVectorSource
attachJmixSourceFeatureDeleteListener, attachJmixSourceFeatureDragEndListener, attachJmixSourceFeatureDragStartListener, attachJmixSourceFeatureModifyEndListener, attachJmixSourceFeatureModifyStartListener, attachJmixSourceFeatureSelectionListenerMethods inherited from class io.jmix.mapsflowui.kit.component.model.source.Source
getAttributionsCollapsible, getId, getProjection, setAttributionsCollapsible, setId, setProjectionMethods 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:
getTypein classMapObservableObject
-
removeFeature
Description copied from class:AbstractFeatureSourceRemoves a feature from the source.- Overrides:
removeFeaturein classAbstractFeatureSource- Parameters:
feature- feature to remove
-
removeAllFeatures
public void removeAllFeatures()Description copied from class:AbstractFeatureSourceRemoves all features from the source.- Overrides:
removeAllFeaturesin classAbstractFeatureSource
-
getAttributions
- Specified by:
getAttributionsin interfaceSource.HasAttributions- Overrides:
getAttributionsin classSource- Returns:
- the attributions of the source or
nullif not set
-
setAttributions
- Specified by:
setAttributionsin interfaceSource.HasAttributions- Overrides:
setAttributionsin classSource- Parameters:
attributions- info about copyrights and licences
-
withAttributions
- Parameters:
attributions- info about copyrights and licences- Returns:
- current instance
-
getWrapX
- Specified by:
getWrapXin interfaceSource.HasWrapX- Overrides:
getWrapXin classSource- Returns:
- whether the source should be looped along the X coordinate or
nullif not set
-
setWrapX
Sets whether the source should be looped along the X coordinate. The default value forSourceistrue.Note, wrapX attribute is set only at creation time and cannot be changed at runtime. For more details see: VectorSource docs
- Specified by:
setWrapXin interfaceSource.HasWrapX- Overrides:
setWrapXin 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:
getOverlapsin interfaceAbstractVectorSource.HasOverlaps- Overrides:
getOverlapsin classAbstractVectorSource- Returns:
- overlaps value or
nullif 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:
setOverlapsin interfaceAbstractVectorSource.HasOverlaps- Overrides:
setOverlapsin classAbstractVectorSource- Parameters:
overlaps- overlaps option
-
withOverlaps
SeesetOverlaps(Boolean).- Parameters:
overlaps- overlaps option- Returns:
- current instance
-
getUseSpatialIndex
- Specified by:
getUseSpatialIndexin interfaceAbstractVectorSource.HasUseSpatialIndex- Overrides:
getUseSpatialIndexin classAbstractVectorSource- Returns:
- useSpatialIndex value or
nullif 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 tofalsemay improve performance. The default value istrue.- Specified by:
setUseSpatialIndexin interfaceAbstractVectorSource.HasUseSpatialIndex- Overrides:
setUseSpatialIndexin classAbstractVectorSource- Parameters:
useSpatialIndex- whether to use spatial index
-
withUseSpatialIndex
- Parameters:
useSpatialIndex- whether to use spatial index- Returns:
- current instance
-
isFeatureSelected
Description copied from interface:HasFeatureSelectChecks whether a feature is selected.- Specified by:
isFeatureSelectedin interfaceHasFeatureSelect- Parameters:
feature- feature to check- Returns:
trueif feature is selected
-
getSelectedFeatures
- Specified by:
getSelectedFeaturesin interfaceHasFeatureSelect- Returns:
- unmodifiable collection of selected feature
-
selectFeature
Description copied from interface:HasFeatureSelectSelects the provided feature.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
selectFeaturein interfaceHasFeatureSelect- Parameters:
feature- feature to select
-
deselectFeature
Description copied from interface:HasFeatureSelectDeselects the provided feature.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
deselectFeaturein interfaceHasFeatureSelect- Parameters:
feature- feature to deselect
-
selectFeatures
Description copied from interface:HasFeatureSelectSelects the collection of features.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
selectFeaturesin interfaceHasFeatureSelect- Parameters:
features- feature to select
-
deselectFeatures
Description copied from interface:HasFeatureSelectDeselects the collection of features.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
deselectFeaturesin interfaceHasFeatureSelect- Parameters:
features- features to deselect
-
selectAllFeatures
public void selectAllFeatures()Description copied from interface:HasFeatureSelectSelects all features in the source.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
selectAllFeaturesin interfaceHasFeatureSelect
-
deselectAllFeatures
public void deselectAllFeatures()Description copied from interface:HasFeatureSelectDeselects all features in the source.Note that selection works only when
SupportsFeatureSelect.getFeatureSelectEnabled()is enabled.- Specified by:
deselectAllFeaturesin interfaceHasFeatureSelect
-
getFeatureSelectEnabled
- Specified by:
getFeatureSelectEnabledin interfaceSupportsFeatureSelect- Overrides:
getFeatureSelectEnabledin classAbstractEditableVectorSource- Returns:
- whether select mode is enabled or not
-
setFeatureSelectEnabled
Description copied from interface:SupportsFeatureSelectEnables / disables feature select mode.The default value is
false.- Specified by:
setFeatureSelectEnabledin interfaceSupportsFeatureSelect- Overrides:
setFeatureSelectEnabledin classAbstractEditableVectorSource- Parameters:
enabled- whether to enable select mode
-
getFeatureDragEnabled
- Specified by:
getFeatureDragEnabledin interfaceSupportsFeatureDrag- Overrides:
getFeatureDragEnabledin classAbstractEditableVectorSource- Returns:
- whether drag mode is enabled or not
-
setFeatureDragEnabled
Description copied from interface:SupportsFeatureDragEnables / disables feature drag mode.The default value is
false.- Specified by:
setFeatureDragEnabledin interfaceSupportsFeatureDrag- Overrides:
setFeatureDragEnabledin classAbstractEditableVectorSource- Parameters:
enabled- whether to enable drag mode
-
getFeatureModifyEnabled
- Specified by:
getFeatureModifyEnabledin interfaceSupportsFeatureModify- Overrides:
getFeatureModifyEnabledin classAbstractEditableVectorSource- Returns:
- whether modify mode is enabled or not
-
setFeatureModifyEnabled
Description copied from interface:SupportsFeatureModifyEnables / disables feature modify mode.The default value is
false.- Specified by:
setFeatureModifyEnabledin interfaceSupportsFeatureModify- Overrides:
setFeatureModifyEnabledin 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.SourceFeatureClickEventwill be fired twice.- Specified by:
addSourceFeatureClickListenerin 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:
addSourceFeatureSingleClickListenerin 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:
addSourceFeatureDoubleClickListenerin 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:HasFeatureSelectAdds feature select listener.- Specified by:
addSourceFeatureSelectListenerin 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:HasFeatureDragAdds feature drag start listener.- Specified by:
addFeatureDragStartListenerin 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:HasFeatureDragAdds feature drag end listener.- Specified by:
addFeatureDragEndListenerin 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:HasFeatureModifyAdds feature modify start listener.- Specified by:
addSourceFeatureModifyStartListenerin 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:HasFeatureModifyAdds feature modify end listener.- Specified by:
addSourceFeatureModifyEndListenerin 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:HasFeatureModifyAdds feature delete listener.- Specified by:
addSourceFeatureDeleteListenerin interfaceHasFeatureModify- Parameters:
listener- listener to add- Returns:
- a registration object for removing an event listener
-
onJmixSourceFeatureSelection
- Overrides:
onJmixSourceFeatureSelectionin classAbstractEditableVectorSource
-
onJmixSourceFeatureDragStart
- Overrides:
onJmixSourceFeatureDragStartin classAbstractEditableVectorSource
-
onJmixSourceFeatureDragEnd
- Overrides:
onJmixSourceFeatureDragEndin classAbstractEditableVectorSource
-
onJmixSourceFeatureModifyStart
- Overrides:
onJmixSourceFeatureModifyStartin classAbstractEditableVectorSource
-
onJmixSourceFeatureModifyEnd
- Overrides:
onJmixSourceFeatureModifyEndin classAbstractEditableVectorSource
-
onJmixSourceFeatureDelete
- Overrides:
onJmixSourceFeatureDeletein classAbstractEditableVectorSource
-
applyChangesToFeatures
-