Class SymbolManager

    • Constructor Detail

      • SymbolManager

        @UiThread
        public SymbolManager​(@NonNull
                             com.mapbox.mapboxsdk.maps.MapView mapView,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.Style style)
        Create a symbol manager, used to manage symbols.
        Parameters:
        mapboxMap - the map object to add symbols to
        style - a valid a fully loaded style object
      • SymbolManager

        @UiThread
        public SymbolManager​(@NonNull
                             com.mapbox.mapboxsdk.maps.MapView mapView,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.Style style,
                             @Nullable
                             java.lang.String belowLayerId,
                             @Nullable
                             java.lang.String aboveLayerId)
        Create a symbol manager, used to manage symbols.
        Parameters:
        mapboxMap - the map object to add symbols to
        style - a valid a fully loaded style object
        belowLayerId - the id of the layer above the symbol layer
        aboveLayerId - the id of the layer below the symbol layer
      • SymbolManager

        @UiThread
        public SymbolManager​(@NonNull
                             com.mapbox.mapboxsdk.maps.MapView mapView,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.Style style,
                             @Nullable
                             java.lang.String belowLayerId,
                             @Nullable
                             java.lang.String aboveLayerId,
                             @Nullable
                             com.mapbox.mapboxsdk.style.sources.GeoJsonOptions geoJsonOptions)
        Create a symbol manager, used to manage symbols.
        Parameters:
        mapboxMap - the map object to add symbols to
        style - a valid a fully loaded style object
        belowLayerId - the id of the layer above the symbol layer
        aboveLayerId - the id of the layer below the symbol layer
        geoJsonOptions - options for the internal source
      • SymbolManager

        @UiThread
        public SymbolManager​(@NonNull
                             com.mapbox.mapboxsdk.maps.MapView mapView,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.MapboxMap mapboxMap,
                             @NonNull
                             com.mapbox.mapboxsdk.maps.Style style,
                             @Nullable
                             java.lang.String belowLayerId,
                             @Nullable
                             java.lang.String aboveLayerId,
                             @NonNull
                             ClusterOptions clusterOptions)
        Create a symbol manager, used to manage symbols.
        Parameters:
        mapboxMap - the map object to add symbols to
        style - a valid a fully loaded style object
        belowLayerId - the id of the layer above the symbol layer
        aboveLayerId - the id of the layer below the symbol layer
        clusterOptions - options for the clustering configuration
    • Method Detail

      • create

        @UiThread
        public java.util.List<Symbol> create​(@NonNull
                                             java.lang.String json)
        Create a list of symbols on the map.

        Symbols are going to be created only for features with a matching geometry.

        All supported properties are:
        SymbolOptions.PROPERTY_SYMBOL_SORT_KEY - Float
        SymbolOptions.PROPERTY_ICON_SIZE - Float
        SymbolOptions.PROPERTY_ICON_IMAGE - String
        SymbolOptions.PROPERTY_ICON_ROTATE - Float
        SymbolOptions.PROPERTY_ICON_OFFSET - Float[]
        SymbolOptions.PROPERTY_ICON_ANCHOR - String
        SymbolOptions.PROPERTY_TEXT_FIELD - String
        SymbolOptions.PROPERTY_TEXT_FONT - String[]
        SymbolOptions.PROPERTY_TEXT_SIZE - Float
        SymbolOptions.PROPERTY_TEXT_MAX_WIDTH - Float
        SymbolOptions.PROPERTY_TEXT_LETTER_SPACING - Float
        SymbolOptions.PROPERTY_TEXT_JUSTIFY - String
        SymbolOptions.PROPERTY_TEXT_RADIAL_OFFSET - Float
        SymbolOptions.PROPERTY_TEXT_ANCHOR - String
        SymbolOptions.PROPERTY_TEXT_ROTATE - Float
        SymbolOptions.PROPERTY_TEXT_TRANSFORM - String
        SymbolOptions.PROPERTY_TEXT_OFFSET - Float[]
        SymbolOptions.PROPERTY_ICON_OPACITY - Float
        SymbolOptions.PROPERTY_ICON_COLOR - String
        SymbolOptions.PROPERTY_ICON_HALO_COLOR - String
        SymbolOptions.PROPERTY_ICON_HALO_WIDTH - Float
        SymbolOptions.PROPERTY_ICON_HALO_BLUR - Float
        SymbolOptions.PROPERTY_TEXT_OPACITY - Float
        SymbolOptions.PROPERTY_TEXT_COLOR - String
        SymbolOptions.PROPERTY_TEXT_HALO_COLOR - String
        SymbolOptions.PROPERTY_TEXT_HALO_WIDTH - Float
        SymbolOptions.PROPERTY_TEXT_HALO_BLUR - Float
        Learn more about above properties in the Style specification.

        Out of spec properties:
        "is-draggable" - Boolean, true if the symbol should be draggable, false otherwise

        Parameters:
        json - the GeoJSON defining the list of symbols to build
        Returns:
        the list of built symbols
      • create

        @UiThread
        public java.util.List<Symbol> create​(@NonNull
                                             com.mapbox.geojson.FeatureCollection featureCollection)
        Create a list of symbols on the map.

        Symbols are going to be created only for features with a matching geometry.

        All supported properties are:
        SymbolOptions.PROPERTY_SYMBOL_SORT_KEY - Float
        SymbolOptions.PROPERTY_ICON_SIZE - Float
        SymbolOptions.PROPERTY_ICON_IMAGE - String
        SymbolOptions.PROPERTY_ICON_ROTATE - Float
        SymbolOptions.PROPERTY_ICON_OFFSET - Float[]
        SymbolOptions.PROPERTY_ICON_ANCHOR - String
        SymbolOptions.PROPERTY_TEXT_FIELD - String
        SymbolOptions.PROPERTY_TEXT_FONT - String[]
        SymbolOptions.PROPERTY_TEXT_SIZE - Float
        SymbolOptions.PROPERTY_TEXT_MAX_WIDTH - Float
        SymbolOptions.PROPERTY_TEXT_LETTER_SPACING - Float
        SymbolOptions.PROPERTY_TEXT_JUSTIFY - String
        SymbolOptions.PROPERTY_TEXT_RADIAL_OFFSET - Float
        SymbolOptions.PROPERTY_TEXT_ANCHOR - String
        SymbolOptions.PROPERTY_TEXT_ROTATE - Float
        SymbolOptions.PROPERTY_TEXT_TRANSFORM - String
        SymbolOptions.PROPERTY_TEXT_OFFSET - Float[]
        SymbolOptions.PROPERTY_ICON_OPACITY - Float
        SymbolOptions.PROPERTY_ICON_COLOR - String
        SymbolOptions.PROPERTY_ICON_HALO_COLOR - String
        SymbolOptions.PROPERTY_ICON_HALO_WIDTH - Float
        SymbolOptions.PROPERTY_ICON_HALO_BLUR - Float
        SymbolOptions.PROPERTY_TEXT_OPACITY - Float
        SymbolOptions.PROPERTY_TEXT_COLOR - String
        SymbolOptions.PROPERTY_TEXT_HALO_COLOR - String
        SymbolOptions.PROPERTY_TEXT_HALO_WIDTH - Float
        SymbolOptions.PROPERTY_TEXT_HALO_BLUR - Float
        Learn more about above properties in the Style specification.

        Out of spec properties:
        "is-draggable" - Boolean, true if the symbol should be draggable, false otherwise

        Parameters:
        featureCollection - the featureCollection defining the list of symbols to build
        Returns:
        the list of built symbols
      • getSymbolPlacement

        public java.lang.String getSymbolPlacement()
        Get the SymbolPlacement property

        Label placement relative to its geometry.

        Returns:
        property wrapper value around String
      • setSymbolPlacement

        public void setSymbolPlacement​(java.lang.String value)
        Set the SymbolPlacement property

        Label placement relative to its geometry.

        Parameters:
        value - property wrapper value around String
      • getSymbolSpacing

        public java.lang.Float getSymbolSpacing()
        Get the SymbolSpacing property

        Distance between two symbol anchors.

        Returns:
        property wrapper value around Float
      • setSymbolSpacing

        public void setSymbolSpacing​(java.lang.Float value)
        Set the SymbolSpacing property

        Distance between two symbol anchors.

        Parameters:
        value - property wrapper value around Float
      • getSymbolAvoidEdges

        public java.lang.Boolean getSymbolAvoidEdges()
        Get the SymbolAvoidEdges property

        If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.

        Returns:
        property wrapper value around Boolean
      • setSymbolAvoidEdges

        public void setSymbolAvoidEdges​(java.lang.Boolean value)
        Set the SymbolAvoidEdges property

        If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer.

        Parameters:
        value - property wrapper value around Boolean
      • getIconAllowOverlap

        public java.lang.Boolean getIconAllowOverlap()
        Get the IconAllowOverlap property

        If true, the icon will be visible even if it collides with other previously drawn symbols.

        Returns:
        property wrapper value around Boolean
      • setIconAllowOverlap

        public void setIconAllowOverlap​(java.lang.Boolean value)
        Set the IconAllowOverlap property

        If true, the icon will be visible even if it collides with other previously drawn symbols.

        Parameters:
        value - property wrapper value around Boolean
      • getIconIgnorePlacement

        public java.lang.Boolean getIconIgnorePlacement()
        Get the IconIgnorePlacement property

        If true, other symbols can be visible even if they collide with the icon.

        Returns:
        property wrapper value around Boolean
      • setIconIgnorePlacement

        public void setIconIgnorePlacement​(java.lang.Boolean value)
        Set the IconIgnorePlacement property

        If true, other symbols can be visible even if they collide with the icon.

        Parameters:
        value - property wrapper value around Boolean
      • getIconOptional

        public java.lang.Boolean getIconOptional()
        Get the IconOptional property

        If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

        Returns:
        property wrapper value around Boolean
      • setIconOptional

        public void setIconOptional​(java.lang.Boolean value)
        Set the IconOptional property

        If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

        Parameters:
        value - property wrapper value around Boolean
      • getIconRotationAlignment

        public java.lang.String getIconRotationAlignment()
        Get the IconRotationAlignment property

        In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.

        Returns:
        property wrapper value around String
      • setIconRotationAlignment

        public void setIconRotationAlignment​(java.lang.String value)
        Set the IconRotationAlignment property

        In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.

        Parameters:
        value - property wrapper value around String
      • getIconTextFit

        public java.lang.String getIconTextFit()
        Get the IconTextFit property

        Scales the icon to fit around the associated text.

        Returns:
        property wrapper value around String
      • setIconTextFit

        public void setIconTextFit​(java.lang.String value)
        Set the IconTextFit property

        Scales the icon to fit around the associated text.

        Parameters:
        value - property wrapper value around String
      • getIconTextFitPadding

        public java.lang.Float[] getIconTextFitPadding()
        Get the IconTextFitPadding property

        Size of the additional area added to dimensions determined by Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.

        Returns:
        property wrapper value around Float[]
      • setIconTextFitPadding

        public void setIconTextFitPadding​(java.lang.Float[] value)
        Set the IconTextFitPadding property

        Size of the additional area added to dimensions determined by Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.

        Parameters:
        value - property wrapper value around Float[]
      • getIconPadding

        public java.lang.Float getIconPadding()
        Get the IconPadding property

        Size of the additional area around the icon bounding box used for detecting symbol collisions.

        Returns:
        property wrapper value around Float
      • setIconPadding

        public void setIconPadding​(java.lang.Float value)
        Set the IconPadding property

        Size of the additional area around the icon bounding box used for detecting symbol collisions.

        Parameters:
        value - property wrapper value around Float
      • getIconKeepUpright

        public java.lang.Boolean getIconKeepUpright()
        Get the IconKeepUpright property

        If true, the icon may be flipped to prevent it from being rendered upside-down.

        Returns:
        property wrapper value around Boolean
      • setIconKeepUpright

        public void setIconKeepUpright​(java.lang.Boolean value)
        Set the IconKeepUpright property

        If true, the icon may be flipped to prevent it from being rendered upside-down.

        Parameters:
        value - property wrapper value around Boolean
      • getIconPitchAlignment

        public java.lang.String getIconPitchAlignment()
        Get the IconPitchAlignment property

        Orientation of icon when map is pitched.

        Returns:
        property wrapper value around String
      • setIconPitchAlignment

        public void setIconPitchAlignment​(java.lang.String value)
        Set the IconPitchAlignment property

        Orientation of icon when map is pitched.

        Parameters:
        value - property wrapper value around String
      • getTextPitchAlignment

        public java.lang.String getTextPitchAlignment()
        Get the TextPitchAlignment property

        Orientation of text when map is pitched.

        Returns:
        property wrapper value around String
      • setTextPitchAlignment

        public void setTextPitchAlignment​(java.lang.String value)
        Set the TextPitchAlignment property

        Orientation of text when map is pitched.

        Parameters:
        value - property wrapper value around String
      • getTextRotationAlignment

        public java.lang.String getTextRotationAlignment()
        Get the TextRotationAlignment property

        In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.

        Returns:
        property wrapper value around String
      • setTextRotationAlignment

        public void setTextRotationAlignment​(java.lang.String value)
        Set the TextRotationAlignment property

        In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.

        Parameters:
        value - property wrapper value around String
      • getTextLineHeight

        public java.lang.Float getTextLineHeight()
        Get the TextLineHeight property

        Text leading value for multi-line text.

        Returns:
        property wrapper value around Float
      • setTextLineHeight

        public void setTextLineHeight​(java.lang.Float value)
        Set the TextLineHeight property

        Text leading value for multi-line text.

        Parameters:
        value - property wrapper value around Float
      • getTextVariableAnchor

        public java.lang.String[] getTextVariableAnchor()
        Get the TextVariableAnchor property

        To increase the chance of placing high-priority labels on the map, you can provide an array of Property.TEXT_ANCHOR locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the PropertyFactory.textRadialOffset(java.lang.Float) instead of the two-dimensional PropertyFactory.textOffset(java.lang.Float[]).

        Returns:
        property wrapper value around String[]
      • setTextVariableAnchor

        public void setTextVariableAnchor​(java.lang.String[] value)
        Set the TextVariableAnchor property

        To increase the chance of placing high-priority labels on the map, you can provide an array of Property.TEXT_ANCHOR locations: the render will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the PropertyFactory.textRadialOffset(java.lang.Float) instead of the two-dimensional PropertyFactory.textOffset(java.lang.Float[]).

        Parameters:
        value - property wrapper value around String[]
      • getTextMaxAngle

        public java.lang.Float getTextMaxAngle()
        Get the TextMaxAngle property

        Maximum angle change between adjacent characters.

        Returns:
        property wrapper value around Float
      • setTextMaxAngle

        public void setTextMaxAngle​(java.lang.Float value)
        Set the TextMaxAngle property

        Maximum angle change between adjacent characters.

        Parameters:
        value - property wrapper value around Float
      • getTextPadding

        public java.lang.Float getTextPadding()
        Get the TextPadding property

        Size of the additional area around the text bounding box used for detecting symbol collisions.

        Returns:
        property wrapper value around Float
      • setTextPadding

        public void setTextPadding​(java.lang.Float value)
        Set the TextPadding property

        Size of the additional area around the text bounding box used for detecting symbol collisions.

        Parameters:
        value - property wrapper value around Float
      • getTextKeepUpright

        public java.lang.Boolean getTextKeepUpright()
        Get the TextKeepUpright property

        If true, the text may be flipped vertically to prevent it from being rendered upside-down.

        Returns:
        property wrapper value around Boolean
      • setTextKeepUpright

        public void setTextKeepUpright​(java.lang.Boolean value)
        Set the TextKeepUpright property

        If true, the text may be flipped vertically to prevent it from being rendered upside-down.

        Parameters:
        value - property wrapper value around Boolean
      • getTextAllowOverlap

        public java.lang.Boolean getTextAllowOverlap()
        Get the TextAllowOverlap property

        If true, the text will be visible even if it collides with other previously drawn symbols.

        Returns:
        property wrapper value around Boolean
      • setTextAllowOverlap

        public void setTextAllowOverlap​(java.lang.Boolean value)
        Set the TextAllowOverlap property

        If true, the text will be visible even if it collides with other previously drawn symbols.

        Parameters:
        value - property wrapper value around Boolean
      • getTextIgnorePlacement

        public java.lang.Boolean getTextIgnorePlacement()
        Get the TextIgnorePlacement property

        If true, other symbols can be visible even if they collide with the text.

        Returns:
        property wrapper value around Boolean
      • setTextIgnorePlacement

        public void setTextIgnorePlacement​(java.lang.Boolean value)
        Set the TextIgnorePlacement property

        If true, other symbols can be visible even if they collide with the text.

        Parameters:
        value - property wrapper value around Boolean
      • getTextOptional

        public java.lang.Boolean getTextOptional()
        Get the TextOptional property

        If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

        Returns:
        property wrapper value around Boolean
      • setTextOptional

        public void setTextOptional​(java.lang.Boolean value)
        Set the TextOptional property

        If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

        Parameters:
        value - property wrapper value around Boolean
      • getIconTranslate

        public java.lang.Float[] getIconTranslate()
        Get the IconTranslate property

        Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

        Returns:
        property wrapper value around Float[]
      • setIconTranslate

        public void setIconTranslate​(java.lang.Float[] value)
        Set the IconTranslate property

        Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

        Parameters:
        value - property wrapper value around Float[]
      • getIconTranslateAnchor

        public java.lang.String getIconTranslateAnchor()
        Get the IconTranslateAnchor property

        Controls the frame of reference for PropertyFactory.iconTranslate(java.lang.Float[]).

        Returns:
        property wrapper value around String
      • setIconTranslateAnchor

        public void setIconTranslateAnchor​(java.lang.String value)
        Set the IconTranslateAnchor property

        Controls the frame of reference for PropertyFactory.iconTranslate(java.lang.Float[]).

        Parameters:
        value - property wrapper value around String
      • getTextTranslate

        public java.lang.Float[] getTextTranslate()
        Get the TextTranslate property

        Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

        Returns:
        property wrapper value around Float[]
      • setTextTranslate

        public void setTextTranslate​(java.lang.Float[] value)
        Set the TextTranslate property

        Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

        Parameters:
        value - property wrapper value around Float[]
      • getTextTranslateAnchor

        public java.lang.String getTextTranslateAnchor()
        Get the TextTranslateAnchor property

        Controls the frame of reference for PropertyFactory.textTranslate(java.lang.Float[]).

        Returns:
        property wrapper value around String
      • setTextTranslateAnchor

        public void setTextTranslateAnchor​(java.lang.String value)
        Set the TextTranslateAnchor property

        Controls the frame of reference for PropertyFactory.textTranslate(java.lang.Float[]).

        Parameters:
        value - property wrapper value around String
      • setFilter

        public void setFilter​(@NonNull
                              com.mapbox.mapboxsdk.style.expressions.Expression expression)
        Set filter on the managed symbols.
        Parameters:
        expression - expression
      • getFilter

        @Nullable
        public com.mapbox.mapboxsdk.style.expressions.Expression getFilter()
        Get filter of the managed symbols.
        Returns:
        expression