Interface HasSelectStyles
- All Known Implementing Classes:
VectorLayer
public interface HasSelectStyles
Interface to be implemented by layers that support feature selection styling.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSelectStyles
(FeatureType type, Style... styles) Adds select styles to a provided feature type.getSelectStyles
(FeatureType type) void
Removes all select styles for all feature types.void
Removes all select styles for the provided feature type.void
removeSelectStyles
(FeatureType type, Style... styles) Removes select styles for the provided feature type.void
setSelectStyles
(Map<FeatureType, Collection<Style>> styles) Sets a map of select styles corresponding to each feature type.
-
Method Details
-
addSelectStyles
Adds select styles to a provided feature type.To enable select mode set
SupportsFeatureSelect.setFeatureSelectEnabled(Boolean)
totrue
.- Parameters:
type
- feature typestyles
- styles to add
-
getSelectStyles
- Parameters:
type
- feature type- Returns:
- collection of select styles for the provided feature type
-
removeSelectStyles
Removes select styles for the provided feature type.- Parameters:
type
- feature typestyles
- styles to remove
-
removeAllSelectStyles
Removes all select styles for the provided feature type.- Parameters:
type
- feature type
-
removeAllSelectStyles
void removeAllSelectStyles()Removes all select styles for all feature types. -
getSelectStyles
Map<FeatureType,Collection<Style>> getSelectStyles()- Returns:
- a map of select styles corresponding to each feature type
-
setSelectStyles
Sets a map of select styles corresponding to each feature type. A convenient way to set this map is to use theLayerStylesBuilder
. It allows you to build a map with selection styles using a fluent API and configure the creation of default selection styles.Note that this method removes all selection styles for all feature types and then applies the styles from the provided map. If the provided map does not contain select styles for a specific feature type, that type will have no styles for selection. This can cause the feature to disappear when the user selects it. To enable select mode set
SupportsFeatureSelect.setFeatureSelectEnabled(Boolean)
totrue
.- Parameters:
styles
- a map of styles
-