| Constructor and Description |
|---|
SymbolOptions() |
| Modifier and Type | Method and Description |
|---|---|
JsonElement |
getData()
Get the arbitrary json data of the annotation.
|
boolean |
getDraggable()
Returns whether this symbol is draggable, meaning it can be dragged across the screen when touched and moved.
|
Point |
getGeometry()
Get the geometry of the symbol, which represents the location of the symbol on the map
|
String |
getIconAnchor()
Get the current configured icon-anchor for the symbol
|
String |
getIconColor()
Get the current configured icon-color for the symbol
|
Float |
getIconHaloBlur()
Get the current configured icon-halo-blur for the symbol
|
String |
getIconHaloColor()
Get the current configured icon-halo-color for the symbol
|
Float |
getIconHaloWidth()
Get the current configured icon-halo-width for the symbol
|
String |
getIconImage()
Get the current configured icon-image for the symbol
|
Float[] |
getIconOffset()
Get the current configured icon-offset for the symbol
|
Float |
getIconOpacity()
Get the current configured icon-opacity for the symbol
|
Float |
getIconRotate()
Get the current configured icon-rotate for the symbol
|
Float |
getIconSize()
Get the current configured icon-size for the symbol
|
LatLng |
getLatLng()
Get the LatLng of the symbol, which represents the location of the symbol on the map
|
Float |
getSymbolSortKey()
Get the current configured symbol-sort-key for the symbol
|
String |
getTextAnchor()
Get the current configured text-anchor for the symbol
|
String |
getTextColor()
Get the current configured text-color for the symbol
|
String |
getTextField()
Get the current configured text-field for the symbol
|
String[] |
getTextFont()
Get the current configured text-font for the symbol
|
Float |
getTextHaloBlur()
Get the current configured text-halo-blur for the symbol
|
String |
getTextHaloColor()
Get the current configured text-halo-color for the symbol
|
Float |
getTextHaloWidth()
Get the current configured text-halo-width for the symbol
|
String |
getTextJustify()
Get the current configured text-justify for the symbol
|
Float |
getTextLetterSpacing()
Get the current configured text-letter-spacing for the symbol
|
Float |
getTextMaxWidth()
Get the current configured text-max-width for the symbol
|
Float[] |
getTextOffset()
Get the current configured text-offset for the symbol
|
Float |
getTextOpacity()
Get the current configured text-opacity for the symbol
|
Float |
getTextRadialOffset()
Get the current configured text-radial-offset for the symbol
|
Float |
getTextRotate()
Get the current configured text-rotate for the symbol
|
Float |
getTextSize()
Get the current configured text-size for the symbol
|
String |
getTextTransform()
Get the current configured text-transform for the symbol
|
SymbolOptions |
withData(JsonElement jsonElement)
Set the arbitrary json data of the annotation.
|
SymbolOptions |
withDraggable(boolean draggable)
Set whether this symbol should be draggable,
meaning it can be dragged across the screen when touched and moved.
|
SymbolOptions |
withGeometry(Point geometry)
Set the geometry of the symbol, which represents the location of the symbol on the map
|
SymbolOptions |
withIconAnchor(String iconAnchor)
Set icon-anchor to initialise the symbol with.
|
SymbolOptions |
withIconColor(String iconColor)
Set icon-color to initialise the symbol with.
|
SymbolOptions |
withIconHaloBlur(Float iconHaloBlur)
Set icon-halo-blur to initialise the symbol with.
|
SymbolOptions |
withIconHaloColor(String iconHaloColor)
Set icon-halo-color to initialise the symbol with.
|
SymbolOptions |
withIconHaloWidth(Float iconHaloWidth)
Set icon-halo-width to initialise the symbol with.
|
SymbolOptions |
withIconImage(String iconImage)
Set icon-image to initialise the symbol with.
|
SymbolOptions |
withIconOffset(Float[] iconOffset)
Set icon-offset to initialise the symbol with.
|
SymbolOptions |
withIconOpacity(Float iconOpacity)
Set icon-opacity to initialise the symbol with.
|
SymbolOptions |
withIconRotate(Float iconRotate)
Set icon-rotate to initialise the symbol with.
|
SymbolOptions |
withIconSize(Float iconSize)
Set icon-size to initialise the symbol with.
|
SymbolOptions |
withLatLng(LatLng latLng)
Set the LatLng of the symbol, which represents the location of the symbol on the map
|
SymbolOptions |
withSymbolSortKey(Float symbolSortKey)
Set symbol-sort-key to initialise the symbol with.
|
SymbolOptions |
withTextAnchor(String textAnchor)
Set text-anchor to initialise the symbol with.
|
SymbolOptions |
withTextColor(String textColor)
Set text-color to initialise the symbol with.
|
SymbolOptions |
withTextField(String textField)
Set text-field to initialise the symbol with.
|
SymbolOptions |
withTextFont(String[] textFont)
Set text-font to initialise the symbol with.
|
SymbolOptions |
withTextHaloBlur(Float textHaloBlur)
Set text-halo-blur to initialise the symbol with.
|
SymbolOptions |
withTextHaloColor(String textHaloColor)
Set text-halo-color to initialise the symbol with.
|
SymbolOptions |
withTextHaloWidth(Float textHaloWidth)
Set text-halo-width to initialise the symbol with.
|
SymbolOptions |
withTextJustify(String textJustify)
Set text-justify to initialise the symbol with.
|
SymbolOptions |
withTextLetterSpacing(Float textLetterSpacing)
Set text-letter-spacing to initialise the symbol with.
|
SymbolOptions |
withTextMaxWidth(Float textMaxWidth)
Set text-max-width to initialise the symbol with.
|
SymbolOptions |
withTextOffset(Float[] textOffset)
Set text-offset to initialise the symbol with.
|
SymbolOptions |
withTextOpacity(Float textOpacity)
Set text-opacity to initialise the symbol with.
|
SymbolOptions |
withTextRadialOffset(Float textRadialOffset)
Set text-radial-offset to initialise the symbol with.
|
SymbolOptions |
withTextRotate(Float textRotate)
Set text-rotate to initialise the symbol with.
|
SymbolOptions |
withTextSize(Float textSize)
Set text-size to initialise the symbol with.
|
SymbolOptions |
withTextTransform(String textTransform)
Set text-transform to initialise the symbol with.
|
public SymbolOptions withSymbolSortKey(Float symbolSortKey)
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.
symbolSortKey - the symbol-sort-key valuepublic Float getSymbolSortKey()
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.
public SymbolOptions withIconSize(Float iconSize)
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. 1 is the original size; 3 triples the size of the image.
iconSize - the icon-size valuepublic Float getIconSize()
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. 1 is the original size; 3 triples the size of the image.
public SymbolOptions withIconImage(String iconImage)
Name of image in sprite to use for drawing an image background.
iconImage - the icon-image valuepublic String getIconImage()
Name of image in sprite to use for drawing an image background.
public SymbolOptions withIconRotate(Float iconRotate)
Rotates the icon clockwise.
iconRotate - the icon-rotate valuepublic Float getIconRotate()
Rotates the icon clockwise.
public SymbolOptions withIconOffset(Float[] iconOffset)
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 to obtain the final offset in density-independent pixels. When combined with PropertyFactory#iconRotate the offset will be as if the rotated direction was up.
iconOffset - the icon-offset valuepublic Float[] getIconOffset()
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 to obtain the final offset in density-independent pixels. When combined with PropertyFactory#iconRotate the offset will be as if the rotated direction was up.
public SymbolOptions withIconAnchor(String iconAnchor)
Part of the icon placed closest to the anchor.
iconAnchor - the icon-anchor valuepublic String getIconAnchor()
Part of the icon placed closest to the anchor.
public SymbolOptions withTextField(String textField)
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.
textField - the text-field valuepublic String getTextField()
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.
public SymbolOptions withTextFont(String[] textFont)
Font stack to use for displaying text.
textFont - the text-font valuepublic String[] getTextFont()
Font stack to use for displaying text.
public SymbolOptions withTextSize(Float textSize)
Font size.
textSize - the text-size valuepublic Float getTextSize()
Font size.
public SymbolOptions withTextMaxWidth(Float textMaxWidth)
The maximum line width for text wrapping.
textMaxWidth - the text-max-width valuepublic Float getTextMaxWidth()
The maximum line width for text wrapping.
public SymbolOptions withTextLetterSpacing(Float textLetterSpacing)
Text tracking amount.
textLetterSpacing - the text-letter-spacing valuepublic Float getTextLetterSpacing()
Text tracking amount.
public SymbolOptions withTextJustify(String textJustify)
Text justification options.
textJustify - the text-justify valuepublic String getTextJustify()
Text justification options.
public SymbolOptions withTextRadialOffset(Float textRadialOffset)
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with PropertyFactory#textVariableAnchor, which doesn't support the two-dimensional PropertyFactory#textOffset.
textRadialOffset - the text-radial-offset valuepublic Float getTextRadialOffset()
Radial offset of text, in the direction of the symbol's anchor. Useful in combination with PropertyFactory#textVariableAnchor, which doesn't support the two-dimensional PropertyFactory#textOffset.
public SymbolOptions withTextAnchor(String textAnchor)
Part of the text placed closest to the anchor.
textAnchor - the text-anchor valuepublic String getTextAnchor()
Part of the text placed closest to the anchor.
public SymbolOptions withTextRotate(Float textRotate)
Rotates the text clockwise.
textRotate - the text-rotate valuepublic Float getTextRotate()
Rotates the text clockwise.
public SymbolOptions withTextTransform(String textTransform)
Specifies how to capitalize text, similar to the CSS PropertyFactory#textTransform property.
textTransform - the text-transform valuepublic String getTextTransform()
Specifies how to capitalize text, similar to the CSS PropertyFactory#textTransform property.
public SymbolOptions withTextOffset(Float[] textOffset)
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
textOffset - the text-offset valuepublic Float[] getTextOffset()
Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up.
public SymbolOptions withIconOpacity(Float iconOpacity)
The opacity at which the icon will be drawn.
iconOpacity - the icon-opacity valuepublic Float getIconOpacity()
The opacity at which the icon will be drawn.
public SymbolOptions withIconColor(String iconColor)
The color of the icon. This can only be used with sdf icons.
iconColor - the icon-color valuepublic String getIconColor()
The color of the icon. This can only be used with sdf icons.
public SymbolOptions withIconHaloColor(String iconHaloColor)
The color of the icon's halo. Icon halos can only be used with SDF icons.
iconHaloColor - the icon-halo-color valuepublic String getIconHaloColor()
The color of the icon's halo. Icon halos can only be used with SDF icons.
public SymbolOptions withIconHaloWidth(Float iconHaloWidth)
Distance of halo to the icon outline.
iconHaloWidth - the icon-halo-width valuepublic Float getIconHaloWidth()
Distance of halo to the icon outline.
public SymbolOptions withIconHaloBlur(Float iconHaloBlur)
Fade out the halo towards the outside.
iconHaloBlur - the icon-halo-blur valuepublic Float getIconHaloBlur()
Fade out the halo towards the outside.
public SymbolOptions withTextOpacity(Float textOpacity)
The opacity at which the text will be drawn.
textOpacity - the text-opacity valuepublic Float getTextOpacity()
The opacity at which the text will be drawn.
public SymbolOptions withTextColor(String textColor)
The color with which the text will be drawn.
textColor - the text-color valuepublic String getTextColor()
The color with which the text will be drawn.
public SymbolOptions withTextHaloColor(String textHaloColor)
The color of the text's halo, which helps it stand out from backgrounds.
textHaloColor - the text-halo-color valuepublic String getTextHaloColor()
The color of the text's halo, which helps it stand out from backgrounds.
public SymbolOptions withTextHaloWidth(Float textHaloWidth)
Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
textHaloWidth - the text-halo-width valuepublic Float getTextHaloWidth()
Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.
public SymbolOptions withTextHaloBlur(Float textHaloBlur)
The halo's fadeout distance towards the outside.
textHaloBlur - the text-halo-blur valuepublic Float getTextHaloBlur()
The halo's fadeout distance towards the outside.
public SymbolOptions withLatLng(LatLng latLng)
latLng - the location of the symbol in a longitude and latitude pairpublic LatLng getLatLng()
public SymbolOptions withGeometry(Point geometry)
geometry - the location of the symbolpublic Point getGeometry()
public boolean getDraggable()
public SymbolOptions withDraggable(boolean draggable)
draggable - should be draggablepublic SymbolOptions withData(JsonElement jsonElement)
jsonElement - the arbitrary json element datapublic JsonElement getData()
© 2015–2019 Mapbox. All rights reserved.