Class SymbolOptions

java.lang.Object
com.trimblemaps.mapsdk.plugins.annotation.Options<Symbol>
com.trimblemaps.mapsdk.plugins.annotation.SymbolOptions

public class SymbolOptions extends Options<Symbol>
Builder class from which a symbol is created.
  • Constructor Details

    • SymbolOptions

      public SymbolOptions()
  • Method Details

    • withSymbolSortKey

      public SymbolOptions withSymbolSortKey(Float symbolSortKey)
      Set symbol-sort-key to initialise the symbol with.

      Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.

      Parameters:
      symbolSortKey - the symbol-sort-key value
      Returns:
      this
    • getSymbolSortKey

      public Float getSymbolSortKey()
      Get the current configured symbol-sort-key for the symbol

      Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key when they overlap. Features with a lower sort key will have priority over other features when doing placement.

      Returns:
      symbolSortKey value
    • withIconSize

      public SymbolOptions withIconSize(Float iconSize)
      Set icon-size to initialise the symbol with.

      Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by PropertyFactory.iconSize(java.lang.Float). 1 is the original size; 3 triples the size of the image.

      Parameters:
      iconSize - the icon-size value
      Returns:
      this
    • getIconSize

      public Float getIconSize()
      Get the current configured icon-size for the symbol

      Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by PropertyFactory.iconSize(java.lang.Float). 1 is the original size; 3 triples the size of the image.

      Returns:
      iconSize value
    • withIconImage

      public SymbolOptions withIconImage(String iconImage)
      Set icon-image to initialise the symbol with.

      Name of image in sprite to use for drawing an image background.

      Parameters:
      iconImage - the icon-image value
      Returns:
      this
    • getIconImage

      public String getIconImage()
      Get the current configured icon-image for the symbol

      Name of image in sprite to use for drawing an image background.

      Returns:
      iconImage value
    • withIconRotate

      public SymbolOptions withIconRotate(Float iconRotate)
      Set icon-rotate to initialise the symbol with.

      Rotates the icon clockwise.

      Parameters:
      iconRotate - the icon-rotate value
      Returns:
      this
    • getIconRotate

      public Float getIconRotate()
      Get the current configured icon-rotate for the symbol

      Rotates the icon clockwise.

      Returns:
      iconRotate value
    • withIconOffset

      public SymbolOptions withIconOffset(Float[] iconOffset)
      Set icon-offset to initialise the symbol with.

      Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of PropertyFactory.iconSize(java.lang.Float) to obtain the final offset in density-independent pixels. When combined with PropertyFactory.iconRotate(java.lang.Float) the offset will be as if the rotated direction was up.

      Parameters:
      iconOffset - the icon-offset value
      Returns:
      this
    • getIconOffset

      public Float[] getIconOffset()
      Get the current configured icon-offset for the symbol

      Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of PropertyFactory.iconSize(java.lang.Float) to obtain the final offset in density-independent pixels. When combined with PropertyFactory.iconRotate(java.lang.Float) the offset will be as if the rotated direction was up.

      Returns:
      iconOffset value
    • withIconAnchor

      public SymbolOptions withIconAnchor(String iconAnchor)
      Set icon-anchor to initialise the symbol with.

      Part of the icon placed closest to the anchor.

      Parameters:
      iconAnchor - the icon-anchor value
      Returns:
      this
    • getIconAnchor

      public String getIconAnchor()
      Get the current configured icon-anchor for the symbol

      Part of the icon placed closest to the anchor.

      Returns:
      iconAnchor value
    • withTextField

      public SymbolOptions withTextField(String textField)
      Set text-field to initialise the symbol with.

      Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.

      Parameters:
      textField - the text-field value
      Returns:
      this
    • getTextField

      public String getTextField()
      Get the current configured text-field for the symbol

      Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.

      Returns:
      textField value
    • withTextFont

      public SymbolOptions withTextFont(String[] textFont)
      Set text-font to initialise the symbol with.

      Font stack to use for displaying text.

      Parameters:
      textFont - the text-font value
      Returns:
      this
    • getTextFont

      public String[] getTextFont()
      Get the current configured text-font for the symbol

      Font stack to use for displaying text.

      Returns:
      textFont value
    • withTextSize

      public SymbolOptions withTextSize(Float textSize)
      Set text-size to initialise the symbol with.

      Font size.

      Parameters:
      textSize - the text-size value
      Returns:
      this
    • getTextSize

      public Float getTextSize()
      Get the current configured text-size for the symbol

      Font size.

      Returns:
      textSize value
    • withTextMaxWidth

      public SymbolOptions withTextMaxWidth(Float textMaxWidth)
      Set text-max-width to initialise the symbol with.

      The maximum line width for text wrapping.

      Parameters:
      textMaxWidth - the text-max-width value
      Returns:
      this
    • getTextMaxWidth

      public Float getTextMaxWidth()
      Get the current configured text-max-width for the symbol

      The maximum line width for text wrapping.

      Returns:
      textMaxWidth value
    • withTextLetterSpacing

      public SymbolOptions withTextLetterSpacing(Float textLetterSpacing)
      Set text-letter-spacing to initialise the symbol with.

      Text tracking amount.

      Parameters:
      textLetterSpacing - the text-letter-spacing value
      Returns:
      this
    • getTextLetterSpacing

      public Float getTextLetterSpacing()
      Get the current configured text-letter-spacing for the symbol

      Text tracking amount.

      Returns:
      textLetterSpacing value
    • withTextJustify

      public SymbolOptions withTextJustify(String textJustify)
      Set text-justify to initialise the symbol with.

      Text justification options.

      Parameters:
      textJustify - the text-justify value
      Returns:
      this
    • getTextJustify

      public String getTextJustify()
      Get the current configured text-justify for the symbol

      Text justification options.

      Returns:
      textJustify value
    • withTextRadialOffset

      public SymbolOptions withTextRadialOffset(Float textRadialOffset)
      Set text-radial-offset to initialise the symbol with.

      Radial offset of text, in the direction of the symbol's anchor. Useful in combination with PropertyFactory.textVariableAnchor(java.lang.String[]), which doesn't support the two-dimensional PropertyFactory.textOffset(java.lang.Float[]).

      Parameters:
      textRadialOffset - the text-radial-offset value
      Returns:
      this
    • getTextRadialOffset

      public Float getTextRadialOffset()
      Get the current configured text-radial-offset for the symbol

      Radial offset of text, in the direction of the symbol's anchor. Useful in combination with PropertyFactory.textVariableAnchor(java.lang.String[]), which doesn't support the two-dimensional PropertyFactory.textOffset(java.lang.Float[]).

      Returns:
      textRadialOffset value
    • withTextAnchor

      public SymbolOptions withTextAnchor(String textAnchor)
      Set text-anchor to initialise the symbol with.

      Part of the text placed closest to the anchor.

      Parameters:
      textAnchor - the text-anchor value
      Returns:
      this
    • getTextAnchor

      public String getTextAnchor()
      Get the current configured text-anchor for the symbol

      Part of the text placed closest to the anchor.

      Returns:
      textAnchor value
    • withTextRotate

      public SymbolOptions withTextRotate(Float textRotate)
      Set text-rotate to initialise the symbol with.

      Rotates the text clockwise.

      Parameters:
      textRotate - the text-rotate value
      Returns:
      this
    • getTextRotate

      public Float getTextRotate()
      Get the current configured text-rotate for the symbol

      Rotates the text clockwise.

      Returns:
      textRotate value
    • withTextTransform

      public SymbolOptions withTextTransform(String textTransform)
      Set text-transform to initialise the symbol with.

      Specifies how to capitalize text, similar to the CSS PropertyFactory.textTransform(java.lang.String) property.

      Parameters:
      textTransform - the text-transform value
      Returns:
      this
    • getTextTransform

      public String getTextTransform()
      Get the current configured text-transform for the symbol

      Specifies how to capitalize text, similar to the CSS PropertyFactory.textTransform(java.lang.String) property.

      Returns:
      textTransform value
    • withTextOffset

      public SymbolOptions withTextOffset(Float[] textOffset)
      Set text-offset to initialise the symbol with.

      Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.

      Parameters:
      textOffset - the text-offset value
      Returns:
      this
    • getTextOffset

      public Float[] getTextOffset()
      Get the current configured text-offset for the symbol

      Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.

      Returns:
      textOffset value
    • withIconOpacity

      public SymbolOptions withIconOpacity(Float iconOpacity)
      Set icon-opacity to initialise the symbol with.

      The opacity at which the icon will be drawn.

      Parameters:
      iconOpacity - the icon-opacity value
      Returns:
      this
    • getIconOpacity

      public Float getIconOpacity()
      Get the current configured icon-opacity for the symbol

      The opacity at which the icon will be drawn.

      Returns:
      iconOpacity value
    • withIconColor

      public SymbolOptions withIconColor(String iconColor)
      Set icon-color to initialise the symbol with.

      The color of the icon. This can only be used with sdf icons.

      Parameters:
      iconColor - the icon-color value
      Returns:
      this
    • getIconColor

      public String getIconColor()
      Get the current configured icon-color for the symbol

      The color of the icon. This can only be used with sdf icons.

      Returns:
      iconColor value
    • withIconHaloColor

      public SymbolOptions withIconHaloColor(String iconHaloColor)
      Set icon-halo-color to initialise the symbol with.

      The color of the icon's halo. Icon halos can only be used with SDF icons.

      Parameters:
      iconHaloColor - the icon-halo-color value
      Returns:
      this
    • getIconHaloColor

      public String getIconHaloColor()
      Get the current configured icon-halo-color for the symbol

      The color of the icon's halo. Icon halos can only be used with SDF icons.

      Returns:
      iconHaloColor value
    • withIconHaloWidth

      public SymbolOptions withIconHaloWidth(Float iconHaloWidth)
      Set icon-halo-width to initialise the symbol with.

      Distance of halo to the icon outline.

      Parameters:
      iconHaloWidth - the icon-halo-width value
      Returns:
      this
    • getIconHaloWidth

      public Float getIconHaloWidth()
      Get the current configured icon-halo-width for the symbol

      Distance of halo to the icon outline.

      Returns:
      iconHaloWidth value
    • withIconHaloBlur

      public SymbolOptions withIconHaloBlur(Float iconHaloBlur)
      Set icon-halo-blur to initialise the symbol with.

      Fade out the halo towards the outside.

      Parameters:
      iconHaloBlur - the icon-halo-blur value
      Returns:
      this
    • getIconHaloBlur

      public Float getIconHaloBlur()
      Get the current configured icon-halo-blur for the symbol

      Fade out the halo towards the outside.

      Returns:
      iconHaloBlur value
    • withTextOpacity

      public SymbolOptions withTextOpacity(Float textOpacity)
      Set text-opacity to initialise the symbol with.

      The opacity at which the text will be drawn.

      Parameters:
      textOpacity - the text-opacity value
      Returns:
      this
    • getTextOpacity

      public Float getTextOpacity()
      Get the current configured text-opacity for the symbol

      The opacity at which the text will be drawn.

      Returns:
      textOpacity value
    • withTextColor

      public SymbolOptions withTextColor(String textColor)
      Set text-color to initialise the symbol with.

      The color with which the text will be drawn.

      Parameters:
      textColor - the text-color value
      Returns:
      this
    • getTextColor

      public String getTextColor()
      Get the current configured text-color for the symbol

      The color with which the text will be drawn.

      Returns:
      textColor value
    • withTextHaloColor

      public SymbolOptions withTextHaloColor(String textHaloColor)
      Set text-halo-color to initialise the symbol with.

      The color of the text's halo, which helps it stand out from backgrounds.

      Parameters:
      textHaloColor - the text-halo-color value
      Returns:
      this
    • getTextHaloColor

      public String getTextHaloColor()
      Get the current configured text-halo-color for the symbol

      The color of the text's halo, which helps it stand out from backgrounds.

      Returns:
      textHaloColor value
    • withTextHaloWidth

      public SymbolOptions withTextHaloWidth(Float textHaloWidth)
      Set text-halo-width to initialise the symbol with.

      Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.

      Parameters:
      textHaloWidth - the text-halo-width value
      Returns:
      this
    • getTextHaloWidth

      public Float getTextHaloWidth()
      Get the current configured text-halo-width for the symbol

      Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.

      Returns:
      textHaloWidth value
    • withTextHaloBlur

      public SymbolOptions withTextHaloBlur(Float textHaloBlur)
      Set text-halo-blur to initialise the symbol with.

      The halo's fadeout distance towards the outside.

      Parameters:
      textHaloBlur - the text-halo-blur value
      Returns:
      this
    • getTextHaloBlur

      public Float getTextHaloBlur()
      Get the current configured text-halo-blur for the symbol

      The halo's fadeout distance towards the outside.

      Returns:
      textHaloBlur value
    • withLatLng

      public SymbolOptions withLatLng(com.trimblemaps.mapsdk.geometry.LatLng latLng)
      Set the LatLng of the symbol, which represents the location of the symbol on the map
      Parameters:
      latLng - the location of the symbol in a longitude and latitude pair
      Returns:
      this
    • getLatLng

      public com.trimblemaps.mapsdk.geometry.LatLng getLatLng()
      Get the LatLng of the symbol, which represents the location of the symbol on the map
      Returns:
      the location of the symbol in a longitude and latitude pair
    • withGeometry

      public SymbolOptions withGeometry(com.trimblemaps.geojson.Point geometry)
      Set the geometry of the symbol, which represents the location of the symbol on the map
      Parameters:
      geometry - the location of the symbol
      Returns:
      this
    • getGeometry

      public com.trimblemaps.geojson.Point getGeometry()
      Get the geometry of the symbol, which represents the location of the symbol on the map
      Returns:
      the location of the symbol
    • getDraggable

      public boolean getDraggable()
      Returns whether this symbol is draggable, meaning it can be dragged across the screen when touched and moved.
      Returns:
      draggable when touched
    • withDraggable

      public SymbolOptions withDraggable(boolean draggable)
      Set whether this symbol should be draggable, meaning it can be dragged across the screen when touched and moved.
      Parameters:
      draggable - should be draggable
    • withData

      public SymbolOptions withData(@Nullable com.google.gson.JsonElement jsonElement)
      Set the arbitrary json data of the annotation.
      Parameters:
      jsonElement - the arbitrary json element data
    • getData

      @Nullable public com.google.gson.JsonElement getData()
      Get the arbitrary json data of the annotation.
      Returns:
      the arbitrary json object data if set, else null