Class VectorSource
java.lang.Object
io.jmix.mapsflowui.kit.component.model.MapObservableObject
io.jmix.mapsflowui.kit.component.model.source.Source
io.jmix.mapsflowui.kit.component.model.source.AbstractVectorSource
io.jmix.mapsflowui.kit.component.model.source.AbstractFeatureSource
io.jmix.mapsflowui.component.model.source.VectorSource
- All Implemented Interfaces:
SourceFeatureClickNotifier
,AbstractVectorSource.HasOverlaps
,AbstractVectorSource.HasUseSpatialIndex
,AbstractVectorSource.HasVectorSourceOptions
,Source.HasAttributions
,Source.HasWrapX
,Serializable
public class VectorSource
extends AbstractFeatureSource
implements AbstractVectorSource.HasVectorSourceOptions, Source.HasAttributions, Source.HasWrapX, SourceFeatureClickNotifier
Source for working with features. It can be used in
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.SourceFeatureClickNotifier
SourceFeatureClickNotifier.AbstractFeatureClickEvent, SourceFeatureClickNotifier.SourceFeatureClickEvent, SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent, SourceFeatureClickNotifier.SourceFeatureSingleClickEvent
-
Field Summary
Fields inherited from class io.jmix.mapsflowui.kit.component.model.source.AbstractFeatureSource
features
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, listener, metaProperties, parent, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addSourceFeatureClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureClickEvent> listener) Adds feature click listener.com.vaadin.flow.shared.Registration
addSourceFeatureDoubleClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureDoubleClickEvent> listener) Adds feature double click listener.com.vaadin.flow.shared.Registration
addSourceFeatureSingleClickListener
(Consumer<SourceFeatureClickNotifier.SourceFeatureSingleClickEvent> listener) Adds feature single click listener.protected String
getType()
getWrapX()
void
setAttributions
(List<String> attributions) 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, removeAllFeatures, removeFeature
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, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, setParent, unmarkDirtyInDepth
-
Constructor Details
-
VectorSource
public VectorSource()
-
-
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
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
-
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
-