Class SymbolOptions
- java.lang.Object
-
- com.mapbox.mapboxsdk.plugins.annotation.Options<Symbol>
-
- com.mapbox.mapboxsdk.plugins.annotation.SymbolOptions
-
-
Constructor Summary
Constructors Constructor Description SymbolOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gson.JsonElementgetData()Get the arbitrary json data of the annotation.booleangetDraggable()Returns whether this symbol is draggable, meaning it can be dragged across the screen when touched and moved.com.mapbox.geojson.PointgetGeometry()Get the geometry of the symbol, which represents the location of the symbol on the mapjava.lang.StringgetIconAnchor()Get the current configured icon-anchor for the symboljava.lang.StringgetIconColor()Get the current configured icon-color for the symboljava.lang.FloatgetIconHaloBlur()Get the current configured icon-halo-blur for the symboljava.lang.StringgetIconHaloColor()Get the current configured icon-halo-color for the symboljava.lang.FloatgetIconHaloWidth()Get the current configured icon-halo-width for the symboljava.lang.StringgetIconImage()Get the current configured icon-image for the symboljava.lang.Float[]getIconOffset()Get the current configured icon-offset for the symboljava.lang.FloatgetIconOpacity()Get the current configured icon-opacity for the symboljava.lang.FloatgetIconRotate()Get the current configured icon-rotate for the symboljava.lang.FloatgetIconSize()Get the current configured icon-size for the symbolcom.mapbox.mapboxsdk.geometry.LatLnggetLatLng()Get the LatLng of the symbol, which represents the location of the symbol on the mapjava.lang.FloatgetSymbolSortKey()Get the current configured symbol-sort-key for the symboljava.lang.StringgetTextAnchor()Get the current configured text-anchor for the symboljava.lang.StringgetTextColor()Get the current configured text-color for the symboljava.lang.StringgetTextField()Get the current configured text-field for the symboljava.lang.String[]getTextFont()Get the current configured text-font for the symboljava.lang.FloatgetTextHaloBlur()Get the current configured text-halo-blur for the symboljava.lang.StringgetTextHaloColor()Get the current configured text-halo-color for the symboljava.lang.FloatgetTextHaloWidth()Get the current configured text-halo-width for the symboljava.lang.StringgetTextJustify()Get the current configured text-justify for the symboljava.lang.FloatgetTextLetterSpacing()Get the current configured text-letter-spacing for the symboljava.lang.FloatgetTextMaxWidth()Get the current configured text-max-width for the symboljava.lang.Float[]getTextOffset()Get the current configured text-offset for the symboljava.lang.FloatgetTextOpacity()Get the current configured text-opacity for the symboljava.lang.FloatgetTextRadialOffset()Get the current configured text-radial-offset for the symboljava.lang.FloatgetTextRotate()Get the current configured text-rotate for the symboljava.lang.FloatgetTextSize()Get the current configured text-size for the symboljava.lang.StringgetTextTransform()Get the current configured text-transform for the symbolSymbolOptionswithData(com.google.gson.JsonElement jsonElement)Set the arbitrary json data of the annotation.SymbolOptionswithDraggable(boolean draggable)Set whether this symbol should be draggable, meaning it can be dragged across the screen when touched and moved.SymbolOptionswithGeometry(com.mapbox.geojson.Point geometry)Set the geometry of the symbol, which represents the location of the symbol on the mapSymbolOptionswithIconAnchor(java.lang.String iconAnchor)Set icon-anchor to initialise the symbol with.SymbolOptionswithIconColor(java.lang.String iconColor)Set icon-color to initialise the symbol with.SymbolOptionswithIconHaloBlur(java.lang.Float iconHaloBlur)Set icon-halo-blur to initialise the symbol with.SymbolOptionswithIconHaloColor(java.lang.String iconHaloColor)Set icon-halo-color to initialise the symbol with.SymbolOptionswithIconHaloWidth(java.lang.Float iconHaloWidth)Set icon-halo-width to initialise the symbol with.SymbolOptionswithIconImage(java.lang.String iconImage)Set icon-image to initialise the symbol with.SymbolOptionswithIconOffset(java.lang.Float[] iconOffset)Set icon-offset to initialise the symbol with.SymbolOptionswithIconOpacity(java.lang.Float iconOpacity)Set icon-opacity to initialise the symbol with.SymbolOptionswithIconRotate(java.lang.Float iconRotate)Set icon-rotate to initialise the symbol with.SymbolOptionswithIconSize(java.lang.Float iconSize)Set icon-size to initialise the symbol with.SymbolOptionswithLatLng(com.mapbox.mapboxsdk.geometry.LatLng latLng)Set the LatLng of the symbol, which represents the location of the symbol on the mapSymbolOptionswithSymbolSortKey(java.lang.Float symbolSortKey)Set symbol-sort-key to initialise the symbol with.SymbolOptionswithTextAnchor(java.lang.String textAnchor)Set text-anchor to initialise the symbol with.SymbolOptionswithTextColor(java.lang.String textColor)Set text-color to initialise the symbol with.SymbolOptionswithTextField(java.lang.String textField)Set text-field to initialise the symbol with.SymbolOptionswithTextFont(java.lang.String[] textFont)Set text-font to initialise the symbol with.SymbolOptionswithTextHaloBlur(java.lang.Float textHaloBlur)Set text-halo-blur to initialise the symbol with.SymbolOptionswithTextHaloColor(java.lang.String textHaloColor)Set text-halo-color to initialise the symbol with.SymbolOptionswithTextHaloWidth(java.lang.Float textHaloWidth)Set text-halo-width to initialise the symbol with.SymbolOptionswithTextJustify(java.lang.String textJustify)Set text-justify to initialise the symbol with.SymbolOptionswithTextLetterSpacing(java.lang.Float textLetterSpacing)Set text-letter-spacing to initialise the symbol with.SymbolOptionswithTextMaxWidth(java.lang.Float textMaxWidth)Set text-max-width to initialise the symbol with.SymbolOptionswithTextOffset(java.lang.Float[] textOffset)Set text-offset to initialise the symbol with.SymbolOptionswithTextOpacity(java.lang.Float textOpacity)Set text-opacity to initialise the symbol with.SymbolOptionswithTextRadialOffset(java.lang.Float textRadialOffset)Set text-radial-offset to initialise the symbol with.SymbolOptionswithTextRotate(java.lang.Float textRotate)Set text-rotate to initialise the symbol with.SymbolOptionswithTextSize(java.lang.Float textSize)Set text-size to initialise the symbol with.SymbolOptionswithTextTransform(java.lang.String textTransform)Set text-transform to initialise the symbol with.
-
-
-
Method Detail
-
withSymbolSortKey
public SymbolOptions withSymbolSortKey(java.lang.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 java.lang.Float getSymbolSortKey()
Get the current configured symbol-sort-key for the symbolSorts 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(java.lang.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 java.lang.Float getIconSize()
Get the current configured icon-size for the symbolScales 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(java.lang.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 java.lang.String getIconImage()
Get the current configured icon-image for the symbolName of image in sprite to use for drawing an image background.
- Returns:
- iconImage value
-
withIconRotate
public SymbolOptions withIconRotate(java.lang.Float iconRotate)
Set icon-rotate to initialise the symbol with.Rotates the icon clockwise.
- Parameters:
iconRotate- the icon-rotate value- Returns:
- this
-
getIconRotate
public java.lang.Float getIconRotate()
Get the current configured icon-rotate for the symbolRotates the icon clockwise.
- Returns:
- iconRotate value
-
withIconOffset
public SymbolOptions withIconOffset(java.lang.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 withPropertyFactory.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 java.lang.Float[] getIconOffset()
Get the current configured icon-offset for the symbolOffset 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 withPropertyFactory.iconRotate(java.lang.Float)the offset will be as if the rotated direction was up.- Returns:
- iconOffset value
-
withIconAnchor
public SymbolOptions withIconAnchor(java.lang.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 java.lang.String getIconAnchor()
Get the current configured icon-anchor for the symbolPart of the icon placed closest to the anchor.
- Returns:
- iconAnchor value
-
withTextField
public SymbolOptions withTextField(java.lang.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 java.lang.String getTextField()
Get the current configured text-field for the symbolValue 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(java.lang.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 java.lang.String[] getTextFont()
Get the current configured text-font for the symbolFont stack to use for displaying text.
- Returns:
- textFont value
-
withTextSize
public SymbolOptions withTextSize(java.lang.Float textSize)
Set text-size to initialise the symbol with.Font size.
- Parameters:
textSize- the text-size value- Returns:
- this
-
getTextSize
public java.lang.Float getTextSize()
Get the current configured text-size for the symbolFont size.
- Returns:
- textSize value
-
withTextMaxWidth
public SymbolOptions withTextMaxWidth(java.lang.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 java.lang.Float getTextMaxWidth()
Get the current configured text-max-width for the symbolThe maximum line width for text wrapping.
- Returns:
- textMaxWidth value
-
withTextLetterSpacing
public SymbolOptions withTextLetterSpacing(java.lang.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 java.lang.Float getTextLetterSpacing()
Get the current configured text-letter-spacing for the symbolText tracking amount.
- Returns:
- textLetterSpacing value
-
withTextJustify
public SymbolOptions withTextJustify(java.lang.String textJustify)
Set text-justify to initialise the symbol with.Text justification options.
- Parameters:
textJustify- the text-justify value- Returns:
- this
-
getTextJustify
public java.lang.String getTextJustify()
Get the current configured text-justify for the symbolText justification options.
- Returns:
- textJustify value
-
withTextRadialOffset
public SymbolOptions withTextRadialOffset(java.lang.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-dimensionalPropertyFactory.textOffset(java.lang.Float[]).- Parameters:
textRadialOffset- the text-radial-offset value- Returns:
- this
-
getTextRadialOffset
public java.lang.Float getTextRadialOffset()
Get the current configured text-radial-offset for the symbolRadial 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-dimensionalPropertyFactory.textOffset(java.lang.Float[]).- Returns:
- textRadialOffset value
-
withTextAnchor
public SymbolOptions withTextAnchor(java.lang.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 java.lang.String getTextAnchor()
Get the current configured text-anchor for the symbolPart of the text placed closest to the anchor.
- Returns:
- textAnchor value
-
withTextRotate
public SymbolOptions withTextRotate(java.lang.Float textRotate)
Set text-rotate to initialise the symbol with.Rotates the text clockwise.
- Parameters:
textRotate- the text-rotate value- Returns:
- this
-
getTextRotate
public java.lang.Float getTextRotate()
Get the current configured text-rotate for the symbolRotates the text clockwise.
- Returns:
- textRotate value
-
withTextTransform
public SymbolOptions withTextTransform(java.lang.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 java.lang.String getTextTransform()
Get the current configured text-transform for the symbolSpecifies how to capitalize text, similar to the CSS
PropertyFactory.textTransform(java.lang.String)property.- Returns:
- textTransform value
-
withTextOffset
public SymbolOptions withTextOffset(java.lang.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 java.lang.Float[] getTextOffset()
Get the current configured text-offset for the symbolOffset 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(java.lang.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 java.lang.Float getIconOpacity()
Get the current configured icon-opacity for the symbolThe opacity at which the icon will be drawn.
- Returns:
- iconOpacity value
-
withIconColor
public SymbolOptions withIconColor(java.lang.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 java.lang.String getIconColor()
Get the current configured icon-color for the symbolThe color of the icon. This can only be used with sdf icons.
- Returns:
- iconColor value
-
withIconHaloColor
public SymbolOptions withIconHaloColor(java.lang.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 java.lang.String getIconHaloColor()
Get the current configured icon-halo-color for the symbolThe color of the icon's halo. Icon halos can only be used with SDF icons.
- Returns:
- iconHaloColor value
-
withIconHaloWidth
public SymbolOptions withIconHaloWidth(java.lang.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 java.lang.Float getIconHaloWidth()
Get the current configured icon-halo-width for the symbolDistance of halo to the icon outline.
- Returns:
- iconHaloWidth value
-
withIconHaloBlur
public SymbolOptions withIconHaloBlur(java.lang.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 java.lang.Float getIconHaloBlur()
Get the current configured icon-halo-blur for the symbolFade out the halo towards the outside.
- Returns:
- iconHaloBlur value
-
withTextOpacity
public SymbolOptions withTextOpacity(java.lang.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 java.lang.Float getTextOpacity()
Get the current configured text-opacity for the symbolThe opacity at which the text will be drawn.
- Returns:
- textOpacity value
-
withTextColor
public SymbolOptions withTextColor(java.lang.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 java.lang.String getTextColor()
Get the current configured text-color for the symbolThe color with which the text will be drawn.
- Returns:
- textColor value
-
withTextHaloColor
public SymbolOptions withTextHaloColor(java.lang.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 java.lang.String getTextHaloColor()
Get the current configured text-halo-color for the symbolThe color of the text's halo, which helps it stand out from backgrounds.
- Returns:
- textHaloColor value
-
withTextHaloWidth
public SymbolOptions withTextHaloWidth(java.lang.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 java.lang.Float getTextHaloWidth()
Get the current configured text-halo-width for the symbolDistance of halo to the font outline. Max text halo width is 1/4 of the font-size.
- Returns:
- textHaloWidth value
-
withTextHaloBlur
public SymbolOptions withTextHaloBlur(java.lang.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 java.lang.Float getTextHaloBlur()
Get the current configured text-halo-blur for the symbolThe halo's fadeout distance towards the outside.
- Returns:
- textHaloBlur value
-
withLatLng
public SymbolOptions withLatLng(com.mapbox.mapboxsdk.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.mapbox.mapboxsdk.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.mapbox.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.mapbox.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
-
-