Package 

Class ClusterOptions


  • 
    public class ClusterOptions
    
                        

    Options to show and configure symbol clustering with using SymbolManager.

    It exposes a minimal of configuration options, a more advanced setup can be created manually with using CircleLayer and SymbolLayers directly.

    • Constructor Detail

      • ClusterOptions

        ClusterOptions()
        Creates a default ClusterOptions object
    • Method Detail

      • getClusterRadius

         int getClusterRadius()

        Get the cluster radius, 50 by default.

      • getCircleRadius

        @Nullable() Expression getCircleRadius()

        Get the circle radius of the cluster items, 18 by default

      • getTextColor

        @Nullable() Expression getTextColor()

        Get the text color of cluster item. White by default

      • getTextSize

        @Nullable() Expression getTextSize()

        Get the text size of cluster item. 12 by default.

      • getTextField

        @Nullable() Expression getTextField()

        Set the text field of a cluster item. toNumber(get("point_count")) by default.

      • withClusterRadius

         ClusterOptions withClusterRadius(int clusterRadius)

        Set the cluster radius, 50 by default.

        Parameters:
        clusterRadius - the radius at which the cluster dissolves
      • withClusterMaxZoom

         ClusterOptions withClusterMaxZoom(int clusterMaxZoom)

        Set the cluster maximum zoom, 14 by default.

        Parameters:
        clusterMaxZoom - the cluster maximum zoom, at this zoom level clusters dissolve automatically
      • withCircleRadius

         ClusterOptions withCircleRadius(@Nullable() Expression circleRadius)

        Set the circle radius of cluster items. 18 by default

        Parameters:
        circleRadius - the cluster item circle radius
      • withTextColor

         ClusterOptions withTextColor(@Nullable() Expression textColor)

        Set the text color of cluster item. White by default.

        Parameters:
        textColor - the cluster item text color
      • withTextSize

         ClusterOptions withTextSize(@Nullable() Expression textSize)

        Set the text size of cluster item. 12 by default.

        Parameters:
        textSize - the cluster item text size
      • withTextField

         ClusterOptions withTextField(@Nullable() Expression textField)

        Set the text field of a cluster item. toNumber(get("point_count")) by default.

        Parameters:
        textField - the cluster item text field
      • apply

         void apply(@NonNull() Style style, @NonNull() String sourceId)

        Apply cluster options to a style and source id.

        Parameters:
        style - style to apply this to
        sourceId - source id to apply this to