-
public class SymbolOptions extends Options<Symbol>
Builder class from which a symbol is created.
-
-
Field Summary
Fields Modifier and Type Field Description private JsonElementdataprivate Pointgeometryprivate FloatsymbolSortKeyprivate FloaticonSizeprivate StringiconImageprivate FloaticonRotateprivate Array<Float>iconOffsetprivate StringiconAnchorprivate StringtextFieldprivate Array<String>textFontprivate FloattextSizeprivate FloattextMaxWidthprivate FloattextLetterSpacingprivate StringtextJustifyprivate FloattextRadialOffsetprivate StringtextAnchorprivate FloattextRotateprivate StringtextTransformprivate Array<Float>textOffsetprivate FloaticonOpacityprivate StringiconColorprivate StringiconHaloColorprivate FloaticonHaloWidthprivate FloaticonHaloBlurprivate FloattextOpacityprivate StringtextColorprivate StringtextHaloColorprivate FloattextHaloWidthprivate FloattextHaloBlur
-
Method Summary
Modifier and Type Method Description JsonElementgetData()Get the arbitrary json data of the annotation. PointgetGeometry()Get the geometry of the symbol, which represents the location of the symbol on the map FloatgetSymbolSortKey()Get the current configured symbol-sort-key for the symbolSorts features in ascending order based on this value. FloatgetIconSize()Get the current configured icon-size for the symbolScales the original size of the icon by the provided factor. StringgetIconImage()Get the current configured icon-image for the symbolName of image in sprite to use for drawing an image background. FloatgetIconRotate()Get the current configured icon-rotate for the symbolRotates the icon clockwise. Array<Float>getIconOffset()Get the current configured icon-offset for the symbolOffset distance of icon from its anchor. StringgetIconAnchor()Get the current configured icon-anchor for the symbolPart of the icon placed closest to the anchor. StringgetTextField()Get the current configured text-field for the symbolValue to use for a text label. Array<String>getTextFont()Get the current configured text-font for the symbolFont stack to use for displaying text. FloatgetTextSize()Get the current configured text-size for the symbolFont size. FloatgetTextMaxWidth()Get the current configured text-max-width for the symbolThe maximum line width for text wrapping. FloatgetTextLetterSpacing()Get the current configured text-letter-spacing for the symbolText tracking amount. StringgetTextJustify()Get the current configured text-justify for the symbolText justification options. FloatgetTextRadialOffset()Get the current configured text-radial-offset for the symbolRadial offset of text, in the direction of the symbol's anchor. StringgetTextAnchor()Get the current configured text-anchor for the symbolPart of the text placed closest to the anchor. FloatgetTextRotate()Get the current configured text-rotate for the symbolRotates the text clockwise. StringgetTextTransform()Get the current configured text-transform for the symbolSpecifies how to capitalize text, similar to the CSS textTransform property. Array<Float>getTextOffset()Get the current configured text-offset for the symbolOffset distance of text from its anchor. FloatgetIconOpacity()Get the current configured icon-opacity for the symbolThe opacity at which the icon will be drawn. StringgetIconColor()Get the current configured icon-color for the symbolThe color of the icon. StringgetIconHaloColor()Get the current configured icon-halo-color for the symbolThe color of the icon's halo. FloatgetIconHaloWidth()Get the current configured icon-halo-width for the symbolDistance of halo to the icon outline. FloatgetIconHaloBlur()Get the current configured icon-halo-blur for the symbolFade out the halo towards the outside. FloatgetTextOpacity()Get the current configured text-opacity for the symbolThe opacity at which the text will be drawn. StringgetTextColor()Get the current configured text-color for the symbolThe color with which the text will be drawn. StringgetTextHaloColor()Get the current configured text-halo-color for the symbolThe color of the text's halo, which helps it stand out from backgrounds. FloatgetTextHaloWidth()Get the current configured text-halo-width for the symbolDistance of halo to the font outline. FloatgetTextHaloBlur()Get the current configured text-halo-blur for the symbolThe halo's fadeout distance towards the outside. SymbolOptionswithSymbolSortKey(Float symbolSortKey)Set symbol-sort-key to initialise the symbol with. SymbolOptionswithIconSize(Float iconSize)Set icon-size to initialise the symbol with. SymbolOptionswithIconImage(String iconImage)Set icon-image to initialise the symbol with. SymbolOptionswithIconRotate(Float iconRotate)Set icon-rotate to initialise the symbol with. SymbolOptionswithIconOffset(Array<Float> iconOffset)Set icon-offset to initialise the symbol with. SymbolOptionswithIconAnchor(String iconAnchor)Set icon-anchor to initialise the symbol with. SymbolOptionswithTextField(String textField)Set text-field to initialise the symbol with. SymbolOptionswithTextFont(Array<String> textFont)Set text-font to initialise the symbol with. SymbolOptionswithTextSize(Float textSize)Set text-size to initialise the symbol with. SymbolOptionswithTextMaxWidth(Float textMaxWidth)Set text-max-width to initialise the symbol with. SymbolOptionswithTextLetterSpacing(Float textLetterSpacing)Set text-letter-spacing to initialise the symbol with. SymbolOptionswithTextJustify(String textJustify)Set text-justify to initialise the symbol with. SymbolOptionswithTextRadialOffset(Float textRadialOffset)Set text-radial-offset to initialise the symbol with. SymbolOptionswithTextAnchor(String textAnchor)Set text-anchor to initialise the symbol with. SymbolOptionswithTextRotate(Float textRotate)Set text-rotate to initialise the symbol with. SymbolOptionswithTextTransform(String textTransform)Set text-transform to initialise the symbol with. SymbolOptionswithTextOffset(Array<Float> textOffset)Set text-offset to initialise the symbol with. SymbolOptionswithIconOpacity(Float iconOpacity)Set icon-opacity to initialise the symbol with. SymbolOptionswithIconColor(String iconColor)Set icon-color to initialise the symbol with. SymbolOptionswithIconHaloColor(String iconHaloColor)Set icon-halo-color to initialise the symbol with. SymbolOptionswithIconHaloWidth(Float iconHaloWidth)Set icon-halo-width to initialise the symbol with. SymbolOptionswithIconHaloBlur(Float iconHaloBlur)Set icon-halo-blur to initialise the symbol with. SymbolOptionswithTextOpacity(Float textOpacity)Set text-opacity to initialise the symbol with. SymbolOptionswithTextColor(String textColor)Set text-color to initialise the symbol with. SymbolOptionswithTextHaloColor(String textHaloColor)Set text-halo-color to initialise the symbol with. SymbolOptionswithTextHaloWidth(Float textHaloWidth)Set text-halo-width to initialise the symbol with. SymbolOptionswithTextHaloBlur(Float textHaloBlur)Set text-halo-blur to initialise the symbol with. SymbolOptionswithLatLng(LatLng latLng)Set the LatLng of the symbol, which represents the location of the symbol on the map LatLnggetLatLng()Get the LatLng of the symbol, which represents the location of the symbol on the map SymbolOptionswithGeometry(Point geometry)Set the geometry of the symbol, which represents the location of the symbol on the map booleangetDraggable()Returns whether this symbol is draggable, meaning it can be dragged across the screen when touched and moved. SymbolOptionswithDraggable(boolean draggable)Set whether this symbol should be draggable,meaning it can be dragged across the screen when touched and moved. SymbolOptionswithData(@Nullable() JsonElement jsonElement)Set the arbitrary json data of the annotation. -
-
Method Detail
-
getGeometry
Point getGeometry()
Get the geometry of the symbol, which represents the location of the symbol on the map
-
getSymbolSortKey
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.
-
getIconSize
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 iconSize. 1 is the original size; 3 triples the size of the image.
-
getIconImage
String getIconImage()
Get the current configured icon-image for the symbol
Name of image in sprite to use for drawing an image background.
-
getIconRotate
Float getIconRotate()
Get the current configured icon-rotate for the symbol
Rotates the icon clockwise.
-
getIconOffset
Array<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 iconSize to obtain the final offset in density-independent pixels. When combined with iconRotate the offset will be as if the rotated direction was up.
-
getIconAnchor
String getIconAnchor()
Get the current configured icon-anchor for the symbol
Part of the icon placed closest to the anchor.
-
getTextField
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.
-
getTextFont
Array<String> getTextFont()
Get the current configured text-font for the symbol
Font stack to use for displaying text.
-
getTextSize
Float getTextSize()
Get the current configured text-size for the symbol
Font size.
-
getTextMaxWidth
Float getTextMaxWidth()
Get the current configured text-max-width for the symbol
The maximum line width for text wrapping.
-
getTextLetterSpacing
Float getTextLetterSpacing()
Get the current configured text-letter-spacing for the symbol
Text tracking amount.
-
getTextJustify
String getTextJustify()
Get the current configured text-justify for the symbol
Text justification options.
-
getTextRadialOffset
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 textVariableAnchor, which doesn't support the two-dimensional textOffset.
-
getTextAnchor
String getTextAnchor()
Get the current configured text-anchor for the symbol
Part of the text placed closest to the anchor.
-
getTextRotate
Float getTextRotate()
Get the current configured text-rotate for the symbol
Rotates the text clockwise.
-
getTextTransform
String getTextTransform()
Get the current configured text-transform for the symbol
Specifies how to capitalize text, similar to the CSS textTransform property.
-
getTextOffset
Array<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.
-
getIconOpacity
Float getIconOpacity()
Get the current configured icon-opacity for the symbol
The opacity at which the icon will be drawn.
-
getIconColor
String getIconColor()
Get the current configured icon-color for the symbol
The color of the icon. This can only be used with sdf icons.
-
getIconHaloColor
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.
-
getIconHaloWidth
Float getIconHaloWidth()
Get the current configured icon-halo-width for the symbol
Distance of halo to the icon outline.
-
getIconHaloBlur
Float getIconHaloBlur()
Get the current configured icon-halo-blur for the symbol
Fade out the halo towards the outside.
-
getTextOpacity
Float getTextOpacity()
Get the current configured text-opacity for the symbol
The opacity at which the text will be drawn.
-
getTextColor
String getTextColor()
Get the current configured text-color for the symbol
The color with which the text will be drawn.
-
getTextHaloColor
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.
-
getTextHaloWidth
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.
-
getTextHaloBlur
Float getTextHaloBlur()
Get the current configured text-halo-blur for the symbol
The halo's fadeout distance towards the outside.
-
withSymbolSortKey
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
-
withIconSize
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 iconSize. 1 is the original size; 3 triples the size of the image.
- Parameters:
iconSize- the icon-size value
-
withIconImage
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
-
withIconRotate
SymbolOptions withIconRotate(Float iconRotate)
Set icon-rotate to initialise the symbol with.
Rotates the icon clockwise.
- Parameters:
iconRotate- the icon-rotate value
-
withIconOffset
SymbolOptions withIconOffset(Array<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 iconSize to obtain the final offset in density-independent pixels. When combined with iconRotate the offset will be as if the rotated direction was up.
- Parameters:
iconOffset- the icon-offset value
-
withIconAnchor
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
-
withTextField
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
-
withTextFont
SymbolOptions withTextFont(Array<String> textFont)
Set text-font to initialise the symbol with.
Font stack to use for displaying text.
- Parameters:
textFont- the text-font value
-
withTextSize
SymbolOptions withTextSize(Float textSize)
Set text-size to initialise the symbol with.
Font size.
- Parameters:
textSize- the text-size value
-
withTextMaxWidth
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
-
withTextLetterSpacing
SymbolOptions withTextLetterSpacing(Float textLetterSpacing)
Set text-letter-spacing to initialise the symbol with.
Text tracking amount.
- Parameters:
textLetterSpacing- the text-letter-spacing value
-
withTextJustify
SymbolOptions withTextJustify(String textJustify)
Set text-justify to initialise the symbol with.
Text justification options.
- Parameters:
textJustify- the text-justify value
-
withTextRadialOffset
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 textVariableAnchor, which doesn't support the two-dimensional textOffset.
- Parameters:
textRadialOffset- the text-radial-offset value
-
withTextAnchor
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
-
withTextRotate
SymbolOptions withTextRotate(Float textRotate)
Set text-rotate to initialise the symbol with.
Rotates the text clockwise.
- Parameters:
textRotate- the text-rotate value
-
withTextTransform
SymbolOptions withTextTransform(String textTransform)
Set text-transform to initialise the symbol with.
Specifies how to capitalize text, similar to the CSS textTransform property.
- Parameters:
textTransform- the text-transform value
-
withTextOffset
SymbolOptions withTextOffset(Array<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
-
withIconOpacity
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
-
withIconColor
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
-
withIconHaloColor
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
-
withIconHaloWidth
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
-
withIconHaloBlur
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
-
withTextOpacity
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
-
withTextColor
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
-
withTextHaloColor
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
-
withTextHaloWidth
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
-
withTextHaloBlur
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
-
withLatLng
SymbolOptions withLatLng(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
-
getLatLng
LatLng getLatLng()
Get the LatLng of the symbol, which represents the location of the symbol on the map
-
withGeometry
SymbolOptions withGeometry(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
-
getDraggable
boolean getDraggable()
Returns whether this symbol is draggable, meaning it can be dragged across the screen when touched and moved.
-
withDraggable
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
SymbolOptions withData(@Nullable() JsonElement jsonElement)
Set the arbitrary json data of the annotation.
- Parameters:
jsonElement- the arbitrary json element data
-
-
-
-