public class SymbolManager extends AnnotationManager<SymbolLayer,Symbol,SymbolOptions,OnSymbolDragListener,OnSymbolClickListener,OnSymbolLongClickListener>
annotations, layer, mapboxMap| Constructor and Description |
|---|
SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style)
Create a symbol manager, used to manage symbols.
|
SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
String belowLayerId)
Create a symbol manager, used to manage symbols.
|
SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
String belowLayerId,
GeoJsonOptions geoJsonOptions)
Create a symbol manager, used to manage symbols.
|
| Modifier and Type | Method and Description |
|---|---|
List<Symbol> |
create(FeatureCollection featureCollection)
Create a list of symbols on the map.
|
List<Symbol> |
create(String json)
Create a list of symbols on the map.
|
Expression |
getFilter()
Get filter of the managed symbols.
|
Boolean |
getIconAllowOverlap()
Get the IconAllowOverlap property
|
Boolean |
getIconIgnorePlacement()
Get the IconIgnorePlacement property
|
Boolean |
getIconKeepUpright()
Get the IconKeepUpright property
|
Boolean |
getIconOptional()
Get the IconOptional property
|
Float |
getIconPadding()
Get the IconPadding property
|
String |
getIconPitchAlignment()
Get the IconPitchAlignment property
|
String |
getIconRotationAlignment()
Get the IconRotationAlignment property
|
String |
getIconTextFit()
Get the IconTextFit property
|
Float[] |
getIconTextFitPadding()
Get the IconTextFitPadding property
|
Float[] |
getIconTranslate()
Get the IconTranslate property
|
String |
getIconTranslateAnchor()
Get the IconTranslateAnchor property
|
Boolean |
getSymbolAvoidEdges()
Get the SymbolAvoidEdges property
|
String |
getSymbolPlacement()
Get the SymbolPlacement property
|
Float |
getSymbolSpacing()
Get the SymbolSpacing property
|
Boolean |
getTextAllowOverlap()
Get the TextAllowOverlap property
|
Boolean |
getTextIgnorePlacement()
Get the TextIgnorePlacement property
|
Boolean |
getTextKeepUpright()
Get the TextKeepUpright property
|
Float |
getTextLineHeight()
Get the TextLineHeight property
|
Float |
getTextMaxAngle()
Get the TextMaxAngle property
|
Boolean |
getTextOptional()
Get the TextOptional property
|
Float |
getTextPadding()
Get the TextPadding property
|
String |
getTextPitchAlignment()
Get the TextPitchAlignment property
|
String |
getTextRotationAlignment()
Get the TextRotationAlignment property
|
Float[] |
getTextTranslate()
Get the TextTranslate property
|
String |
getTextTranslateAnchor()
Get the TextTranslateAnchor property
|
String[] |
getTextVariableAnchor()
Get the TextVariableAnchor property
|
protected void |
setDataDrivenPropertyIsUsed(String property) |
void |
setFilter(Expression expression)
Set filter on the managed symbols.
|
void |
setIconAllowOverlap(Boolean value)
Set the IconAllowOverlap property
|
void |
setIconIgnorePlacement(Boolean value)
Set the IconIgnorePlacement property
|
void |
setIconKeepUpright(Boolean value)
Set the IconKeepUpright property
|
void |
setIconOptional(Boolean value)
Set the IconOptional property
|
void |
setIconPadding(Float value)
Set the IconPadding property
|
void |
setIconPitchAlignment(String value)
Set the IconPitchAlignment property
|
void |
setIconRotationAlignment(String value)
Set the IconRotationAlignment property
|
void |
setIconTextFit(String value)
Set the IconTextFit property
|
void |
setIconTextFitPadding(Float[] value)
Set the IconTextFitPadding property
|
void |
setIconTranslate(Float[] value)
Set the IconTranslate property
|
void |
setIconTranslateAnchor(String value)
Set the IconTranslateAnchor property
|
void |
setSymbolAvoidEdges(Boolean value)
Set the SymbolAvoidEdges property
|
void |
setSymbolPlacement(String value)
Set the SymbolPlacement property
|
void |
setSymbolSpacing(Float value)
Set the SymbolSpacing property
|
void |
setTextAllowOverlap(Boolean value)
Set the TextAllowOverlap property
|
void |
setTextIgnorePlacement(Boolean value)
Set the TextIgnorePlacement property
|
void |
setTextKeepUpright(Boolean value)
Set the TextKeepUpright property
|
void |
setTextLineHeight(Float value)
Set the TextLineHeight property
|
void |
setTextMaxAngle(Float value)
Set the TextMaxAngle property
|
void |
setTextOptional(Boolean value)
Set the TextOptional property
|
void |
setTextPadding(Float value)
Set the TextPadding property
|
void |
setTextPitchAlignment(String value)
Set the TextPitchAlignment property
|
void |
setTextRotationAlignment(String value)
Set the TextRotationAlignment property
|
void |
setTextTranslate(Float[] value)
Set the TextTranslate property
|
void |
setTextTranslateAnchor(String value)
Set the TextTranslateAnchor property
|
void |
setTextVariableAnchor(String[] value)
Set the TextVariableAnchor property
|
addClickListener, addDragListener, addLongClickListener, delete, delete, deleteAll, getAnnotations, getLayerId, onDestroy, removeClickListener, removeDragListener, removeLongClickListener, update, update, updateSourcepublic SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style)
mapboxMap - the map object to add symbols tostyle - a valid a fully loaded style objectpublic SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
String belowLayerId)
mapboxMap - the map object to add symbols tostyle - a valid a fully loaded style objectbelowLayerId - the id of the layer above the circle layerpublic SymbolManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
String belowLayerId,
GeoJsonOptions geoJsonOptions)
mapboxMap - the map object to add symbols tostyle - a valid a fully loaded style objectbelowLayerId - the id of the layer above the circle layergeoJsonOptions - options for the internal sourceprotected void setDataDrivenPropertyIsUsed(String property)
setDataDrivenPropertyIsUsed in class AnnotationManager<SymbolLayer,Symbol,SymbolOptions,OnSymbolDragListener,OnSymbolClickListener,OnSymbolLongClickListener>public List<Symbol> create(String json)
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
json - the GeoJSON defining the list of symbols to buildpublic List<Symbol> create(FeatureCollection featureCollection)
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
create in class AnnotationManager<SymbolLayer,Symbol,SymbolOptions,OnSymbolDragListener,OnSymbolClickListener,OnSymbolLongClickListener>featureCollection - the featureCollection defining the list of symbols to buildpublic String getSymbolPlacement()
Label placement relative to its geometry.
public void setSymbolPlacement(String value)
Label placement relative to its geometry.
value - property wrapper value around Stringpublic Float getSymbolSpacing()
Distance between two symbol anchors.
public void setSymbolSpacing(Float value)
Distance between two symbol anchors.
value - property wrapper value around Floatpublic Boolean getSymbolAvoidEdges()
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.
public void setSymbolAvoidEdges(Boolean value)
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.
value - property wrapper value around Booleanpublic Boolean getIconAllowOverlap()
If true, the icon will be visible even if it collides with other previously drawn symbols.
public void setIconAllowOverlap(Boolean value)
If true, the icon will be visible even if it collides with other previously drawn symbols.
value - property wrapper value around Booleanpublic Boolean getIconIgnorePlacement()
If true, other symbols can be visible even if they collide with the icon.
public void setIconIgnorePlacement(Boolean value)
If true, other symbols can be visible even if they collide with the icon.
value - property wrapper value around Booleanpublic Boolean getIconOptional()
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
public void setIconOptional(Boolean value)
If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
value - property wrapper value around Booleanpublic String getIconRotationAlignment()
In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.
public void setIconRotationAlignment(String value)
In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.
value - property wrapper value around Stringpublic String getIconTextFit()
Scales the icon to fit around the associated text.
public void setIconTextFit(String value)
Scales the icon to fit around the associated text.
value - property wrapper value around Stringpublic Float[] getIconTextFitPadding()
Size of the additional area added to dimensions determined by Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.
public void setIconTextFitPadding(Float[] value)
Size of the additional area added to dimensions determined by Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.
value - property wrapper value around Float[]public Float getIconPadding()
Size of the additional area around the icon bounding box used for detecting symbol collisions.
public void setIconPadding(Float value)
Size of the additional area around the icon bounding box used for detecting symbol collisions.
value - property wrapper value around Floatpublic Boolean getIconKeepUpright()
If true, the icon may be flipped to prevent it from being rendered upside-down.
public void setIconKeepUpright(Boolean value)
If true, the icon may be flipped to prevent it from being rendered upside-down.
value - property wrapper value around Booleanpublic String getIconPitchAlignment()
Orientation of icon when map is pitched.
public void setIconPitchAlignment(String value)
Orientation of icon when map is pitched.
value - property wrapper value around Stringpublic String getTextPitchAlignment()
Orientation of text when map is pitched.
public void setTextPitchAlignment(String value)
Orientation of text when map is pitched.
value - property wrapper value around Stringpublic String getTextRotationAlignment()
In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.
public void setTextRotationAlignment(String value)
In combination with Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.
value - property wrapper value around Stringpublic Float getTextLineHeight()
Text leading value for multi-line text.
public void setTextLineHeight(Float value)
Text leading value for multi-line text.
value - property wrapper value around Floatpublic String[] getTextVariableAnchor()
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 instead of the two-dimensional PropertyFactory#textOffset.
public void setTextVariableAnchor(String[] value)
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 instead of the two-dimensional PropertyFactory#textOffset.
value - property wrapper value around String[]public Float getTextMaxAngle()
Maximum angle change between adjacent characters.
public void setTextMaxAngle(Float value)
Maximum angle change between adjacent characters.
value - property wrapper value around Floatpublic Float getTextPadding()
Size of the additional area around the text bounding box used for detecting symbol collisions.
public void setTextPadding(Float value)
Size of the additional area around the text bounding box used for detecting symbol collisions.
value - property wrapper value around Floatpublic Boolean getTextKeepUpright()
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
public void setTextKeepUpright(Boolean value)
If true, the text may be flipped vertically to prevent it from being rendered upside-down.
value - property wrapper value around Booleanpublic Boolean getTextAllowOverlap()
If true, the text will be visible even if it collides with other previously drawn symbols.
public void setTextAllowOverlap(Boolean value)
If true, the text will be visible even if it collides with other previously drawn symbols.
value - property wrapper value around Booleanpublic Boolean getTextIgnorePlacement()
If true, other symbols can be visible even if they collide with the text.
public void setTextIgnorePlacement(Boolean value)
If true, other symbols can be visible even if they collide with the text.
value - property wrapper value around Booleanpublic Boolean getTextOptional()
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
public void setTextOptional(Boolean value)
If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
value - property wrapper value around Booleanpublic Float[] getIconTranslate()
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.
public void setIconTranslate(Float[] value)
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.
value - property wrapper value around Float[]public String getIconTranslateAnchor()
Controls the frame of reference for PropertyFactory#iconTranslate.
public void setIconTranslateAnchor(String value)
Controls the frame of reference for PropertyFactory#iconTranslate.
value - property wrapper value around Stringpublic Float[] getTextTranslate()
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.
public void setTextTranslate(Float[] value)
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.
value - property wrapper value around Float[]public String getTextTranslateAnchor()
Controls the frame of reference for PropertyFactory#textTranslate.
public void setTextTranslateAnchor(String value)
Controls the frame of reference for PropertyFactory#textTranslate.
value - property wrapper value around Stringpublic void setFilter(Expression expression)
expression - expressionpublic Expression getFilter()
© 2015–2019 Mapbox. All rights reserved.