java.lang.Object
com.flowingcode.vaadin.addons.googlemaps.maptypestyle.MapStyle
All Implemented Interfaces:
Serializable

public class MapStyle extends Object implements Serializable
Representation for the collection of selectors and stylers that define how the map should be styled.

A map style consists of one selector and its corresponding style rules. Selectors specify the map features and/or elements that should be affected, while the style rule define how those features and elements should be modified by using stylers.

This class provides methods to convert the style information into a JSON representation.

See Also:
  • Constructor Details

    • MapStyle

      public MapStyle(FeatureType featureType, StyleRules styleRules)
      Creates a new MapStyle with the specified feature type and style rules.
      Parameters:
      featureType - the feature type to be styled
      styleRules - the style rules to apply
    • MapStyle

      public MapStyle(FeatureType featureType, ElementType elementType, StyleRules styleRules)
      Creates a new MapStyle with the specified feature type, element type, and style rules.
      Parameters:
      featureType - the feature type to be styled
      elementType - the element type to be styled
      styleRules - the style rules to apply
  • Method Details

    • getJson

      public elemental.json.JsonObject getJson()
      Converts the MapStyle to a JSON object.

      This method includes the feature type, element type, and style rules, if present.

      Returns:
      a JsonObject representing the map style