Interface HasSelectStyles

All Known Implementing Classes:
VectorLayer

public interface HasSelectStyles
Interface to be implemented by layers that support feature selection styling.
  • Method Details

    • addSelectStyles

      void addSelectStyles(FeatureType type, Style... styles)
      Adds select styles to a provided feature type.

      To enable select mode set SupportsFeatureSelect.setFeatureSelectEnabled(Boolean) to true.

      Parameters:
      type - feature type
      styles - styles to add
    • getSelectStyles

      Collection<Style> getSelectStyles(FeatureType type)
      Parameters:
      type - feature type
      Returns:
      collection of select styles for the provided feature type
    • removeSelectStyles

      void removeSelectStyles(FeatureType type, Style... styles)
      Removes select styles for the provided feature type.
      Parameters:
      type - feature type
      styles - styles to remove
    • removeAllSelectStyles

      void removeAllSelectStyles(FeatureType type)
      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

      void setSelectStyles(@Nullable Map<FeatureType,Collection<Style>> styles)
      Sets a map of select styles corresponding to each feature type. A convenient way to set this map is to use the LayerStylesBuilder. 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) to true.

      Parameters:
      styles - a map of styles