Class SymbolManager
-
Field Summary
Fields inherited from class com.trimblemaps.mapsdk.plugins.annotation.AnnotationManager
annotations, layer, trimbleMapsMap -
Constructor Summary
ConstructorsConstructorDescriptionSymbolManager(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, com.trimblemaps.mapsdk.maps.Style style) Create a symbol manager, used to manage symbols.SymbolManager(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, com.trimblemaps.mapsdk.maps.Style style, String belowLayerId) Create a symbol manager, used to manage symbols.SymbolManager(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, com.trimblemaps.mapsdk.maps.Style style, String belowLayerId, com.trimblemaps.mapsdk.style.sources.GeoJsonOptions geoJsonOptions) Create a symbol manager, used to manage symbols. -
Method Summary
Modifier and TypeMethodDescriptioncreate(com.trimblemaps.geojson.FeatureCollection featureCollection) Create a list of symbols on the map.Create a list of symbols on the map.com.trimblemaps.mapsdk.style.expressions.ExpressionGet filter of the managed symbols.Get the IconAllowOverlap propertyGet the IconIgnorePlacement propertyGet the IconKeepUpright propertyGet the IconOptional propertyGet the IconPadding propertyGet the IconPitchAlignment propertyGet the IconRotationAlignment propertyGet the IconTextFit propertyFloat[]Get the IconTextFitPadding propertyFloat[]Get the IconTranslate propertyGet the IconTranslateAnchor propertyGet the SymbolAvoidEdges propertyGet the SymbolPlacement propertyGet the SymbolSpacing propertyGet the TextAllowOverlap propertyGet the TextIgnorePlacement propertyGet the TextKeepUpright propertyGet the TextLineHeight propertyGet the TextMaxAngle propertyGet the TextOptional propertyGet the TextPadding propertyGet the TextPitchAlignment propertyGet the TextRotationAlignment propertyFloat[]Get the TextTranslate propertyGet the TextTranslateAnchor propertyString[]Get the TextVariableAnchor propertyprotected voidsetDataDrivenPropertyIsUsed(String property) voidsetFilter(com.trimblemaps.mapsdk.style.expressions.Expression expression) Set filter on the managed symbols.voidsetIconAllowOverlap(Boolean value) Set the IconAllowOverlap propertyvoidsetIconIgnorePlacement(Boolean value) Set the IconIgnorePlacement propertyvoidsetIconKeepUpright(Boolean value) Set the IconKeepUpright propertyvoidsetIconOptional(Boolean value) Set the IconOptional propertyvoidsetIconPadding(Float value) Set the IconPadding propertyvoidsetIconPitchAlignment(String value) Set the IconPitchAlignment propertyvoidsetIconRotationAlignment(String value) Set the IconRotationAlignment propertyvoidsetIconTextFit(String value) Set the IconTextFit propertyvoidsetIconTextFitPadding(Float[] value) Set the IconTextFitPadding propertyvoidsetIconTranslate(Float[] value) Set the IconTranslate propertyvoidsetIconTranslateAnchor(String value) Set the IconTranslateAnchor propertyvoidsetSymbolAvoidEdges(Boolean value) Set the SymbolAvoidEdges propertyvoidsetSymbolPlacement(String value) Set the SymbolPlacement propertyvoidsetSymbolSpacing(Float value) Set the SymbolSpacing propertyvoidsetTextAllowOverlap(Boolean value) Set the TextAllowOverlap propertyvoidsetTextIgnorePlacement(Boolean value) Set the TextIgnorePlacement propertyvoidsetTextKeepUpright(Boolean value) Set the TextKeepUpright propertyvoidsetTextLineHeight(Float value) Set the TextLineHeight propertyvoidsetTextMaxAngle(Float value) Set the TextMaxAngle propertyvoidsetTextOptional(Boolean value) Set the TextOptional propertyvoidsetTextPadding(Float value) Set the TextPadding propertyvoidsetTextPitchAlignment(String value) Set the TextPitchAlignment propertyvoidsetTextRotationAlignment(String value) Set the TextRotationAlignment propertyvoidsetTextTranslate(Float[] value) Set the TextTranslate propertyvoidsetTextTranslateAnchor(String value) Set the TextTranslateAnchor propertyvoidsetTextVariableAnchor(String[] value) Set the TextVariableAnchor propertyMethods inherited from class com.trimblemaps.mapsdk.plugins.annotation.AnnotationManager
addClickListener, addDragListener, addLongClickListener, create, create, delete, delete, deleteAll, getAnnotations, getLayerId, onDestroy, removeClickListener, removeDragListener, removeLongClickListener, update, update, updateSource
-
Constructor Details
-
SymbolManager
@UiThread public SymbolManager(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, @NonNull com.trimblemaps.mapsdk.maps.Style style) Create a symbol manager, used to manage symbols.- Parameters:
trimbleMapsMap- the map object to add symbols tostyle- a valid a fully loaded style object
-
SymbolManager
@UiThread public SymbolManager(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, @NonNull com.trimblemaps.mapsdk.maps.Style style, @Nullable String belowLayerId) Create a symbol manager, used to manage symbols.- Parameters:
trimbleMapsMap- the map object to add symbols tostyle- a valid a fully loaded style objectbelowLayerId- the id of the layer above the circle layer
-
SymbolManager
@UiThread public SymbolManager(@NonNull com.trimblemaps.mapsdk.maps.MapView mapView, @NonNull com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, @NonNull com.trimblemaps.mapsdk.maps.Style style, @Nullable String belowLayerId, @Nullable com.trimblemaps.mapsdk.style.sources.GeoJsonOptions geoJsonOptions) Create a symbol manager, used to manage symbols.- Parameters:
trimbleMapsMap- 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 source
-
-
Method Details
-
setDataDrivenPropertyIsUsed
- Specified by:
setDataDrivenPropertyIsUsedin classAnnotationManager<com.trimblemaps.mapsdk.style.layers.SymbolLayer,Symbol, SymbolOptions, OnSymbolDragListener, OnSymbolClickListener, OnSymbolLongClickListener>
-
create
Create a list of symbols on the map.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
Out of spec properties:
"is-draggable" - Boolean, true if the symbol should be draggable, false otherwise- Parameters:
json- the GeoJSON defining the list of symbols to build- Returns:
- the list of built symbols
-
create
@UiThread public List<Symbol> create(@NonNull com.trimblemaps.geojson.FeatureCollection featureCollection) Create a list of symbols on the map.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
Out of spec properties:
"is-draggable" - Boolean, true if the symbol should be draggable, false otherwise- Parameters:
featureCollection- the featureCollection defining the list of symbols to build- Returns:
- the list of built symbols
-
getSymbolPlacement
Get the SymbolPlacement propertyLabel placement relative to its geometry.
- Returns:
- property wrapper value around String
-
setSymbolPlacement
Set the SymbolPlacement propertyLabel placement relative to its geometry.
- Parameters:
value- property wrapper value around String
-
getSymbolSpacing
Get the SymbolSpacing propertyDistance between two symbol anchors.
- Returns:
- property wrapper value around Float
-
setSymbolSpacing
Set the SymbolSpacing propertyDistance between two symbol anchors.
- Parameters:
value- property wrapper value around Float
-
getSymbolAvoidEdges
Get the SymbolAvoidEdges propertyIf 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.
- Returns:
- property wrapper value around Boolean
-
setSymbolAvoidEdges
Set the SymbolAvoidEdges propertyIf 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.
- Parameters:
value- property wrapper value around Boolean
-
getIconAllowOverlap
Get the IconAllowOverlap propertyIf true, the icon will be visible even if it collides with other previously drawn symbols.
- Returns:
- property wrapper value around Boolean
-
setIconAllowOverlap
Set the IconAllowOverlap propertyIf true, the icon will be visible even if it collides with other previously drawn symbols.
- Parameters:
value- property wrapper value around Boolean
-
getIconIgnorePlacement
Get the IconIgnorePlacement propertyIf true, other symbols can be visible even if they collide with the icon.
- Returns:
- property wrapper value around Boolean
-
setIconIgnorePlacement
Set the IconIgnorePlacement propertyIf true, other symbols can be visible even if they collide with the icon.
- Parameters:
value- property wrapper value around Boolean
-
getIconOptional
Get the IconOptional propertyIf true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
- Returns:
- property wrapper value around Boolean
-
setIconOptional
Set the IconOptional propertyIf true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.
- Parameters:
value- property wrapper value around Boolean
-
getIconRotationAlignment
Get the IconRotationAlignment propertyIn combination with
Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.- Returns:
- property wrapper value around String
-
setIconRotationAlignment
Set the IconRotationAlignment propertyIn combination with
Property.SYMBOL_PLACEMENT, determines the rotation behavior of icons.- Parameters:
value- property wrapper value around String
-
getIconTextFit
Get the IconTextFit propertyScales the icon to fit around the associated text.
- Returns:
- property wrapper value around String
-
setIconTextFit
Set the IconTextFit propertyScales the icon to fit around the associated text.
- Parameters:
value- property wrapper value around String
-
getIconTextFitPadding
Get the IconTextFitPadding propertySize of the additional area added to dimensions determined by
Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.- Returns:
- property wrapper value around Float[]
-
setIconTextFitPadding
Set the IconTextFitPadding propertySize of the additional area added to dimensions determined by
Property.ICON_TEXT_FIT, in clockwise order: top, right, bottom, left.- Parameters:
value- property wrapper value around Float[]
-
getIconPadding
Get the IconPadding propertySize of the additional area around the icon bounding box used for detecting symbol collisions.
- Returns:
- property wrapper value around Float
-
setIconPadding
Set the IconPadding propertySize of the additional area around the icon bounding box used for detecting symbol collisions.
- Parameters:
value- property wrapper value around Float
-
getIconKeepUpright
Get the IconKeepUpright propertyIf true, the icon may be flipped to prevent it from being rendered upside-down.
- Returns:
- property wrapper value around Boolean
-
setIconKeepUpright
Set the IconKeepUpright propertyIf true, the icon may be flipped to prevent it from being rendered upside-down.
- Parameters:
value- property wrapper value around Boolean
-
getIconPitchAlignment
Get the IconPitchAlignment propertyOrientation of icon when map is pitched.
- Returns:
- property wrapper value around String
-
setIconPitchAlignment
Set the IconPitchAlignment propertyOrientation of icon when map is pitched.
- Parameters:
value- property wrapper value around String
-
getTextPitchAlignment
Get the TextPitchAlignment propertyOrientation of text when map is pitched.
- Returns:
- property wrapper value around String
-
setTextPitchAlignment
Set the TextPitchAlignment propertyOrientation of text when map is pitched.
- Parameters:
value- property wrapper value around String
-
getTextRotationAlignment
Get the TextRotationAlignment propertyIn combination with
Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.- Returns:
- property wrapper value around String
-
setTextRotationAlignment
Set the TextRotationAlignment propertyIn combination with
Property.SYMBOL_PLACEMENT, determines the rotation behavior of the individual glyphs forming the text.- Parameters:
value- property wrapper value around String
-
getTextLineHeight
Get the TextLineHeight propertyText leading value for multi-line text.
- Returns:
- property wrapper value around Float
-
setTextLineHeight
Set the TextLineHeight propertyText leading value for multi-line text.
- Parameters:
value- property wrapper value around Float
-
getTextVariableAnchor
Get the TextVariableAnchor propertyTo increase the chance of placing high-priority labels on the map, you can provide an array of
Property.TEXT_ANCHORlocations: 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 thePropertyFactory.textRadialOffset(java.lang.Float)instead of the two-dimensionalPropertyFactory.textOffset(java.lang.Float[]).- Returns:
- property wrapper value around String[]
-
setTextVariableAnchor
Set the TextVariableAnchor propertyTo increase the chance of placing high-priority labels on the map, you can provide an array of
Property.TEXT_ANCHORlocations: 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 thePropertyFactory.textRadialOffset(java.lang.Float)instead of the two-dimensionalPropertyFactory.textOffset(java.lang.Float[]).- Parameters:
value- property wrapper value around String[]
-
getTextMaxAngle
Get the TextMaxAngle propertyMaximum angle change between adjacent characters.
- Returns:
- property wrapper value around Float
-
setTextMaxAngle
Set the TextMaxAngle propertyMaximum angle change between adjacent characters.
- Parameters:
value- property wrapper value around Float
-
getTextPadding
Get the TextPadding propertySize of the additional area around the text bounding box used for detecting symbol collisions.
- Returns:
- property wrapper value around Float
-
setTextPadding
Set the TextPadding propertySize of the additional area around the text bounding box used for detecting symbol collisions.
- Parameters:
value- property wrapper value around Float
-
getTextKeepUpright
Get the TextKeepUpright propertyIf true, the text may be flipped vertically to prevent it from being rendered upside-down.
- Returns:
- property wrapper value around Boolean
-
setTextKeepUpright
Set the TextKeepUpright propertyIf true, the text may be flipped vertically to prevent it from being rendered upside-down.
- Parameters:
value- property wrapper value around Boolean
-
getTextAllowOverlap
Get the TextAllowOverlap propertyIf true, the text will be visible even if it collides with other previously drawn symbols.
- Returns:
- property wrapper value around Boolean
-
setTextAllowOverlap
Set the TextAllowOverlap propertyIf true, the text will be visible even if it collides with other previously drawn symbols.
- Parameters:
value- property wrapper value around Boolean
-
getTextIgnorePlacement
Get the TextIgnorePlacement propertyIf true, other symbols can be visible even if they collide with the text.
- Returns:
- property wrapper value around Boolean
-
setTextIgnorePlacement
Set the TextIgnorePlacement propertyIf true, other symbols can be visible even if they collide with the text.
- Parameters:
value- property wrapper value around Boolean
-
getTextOptional
Get the TextOptional propertyIf true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
- Returns:
- property wrapper value around Boolean
-
setTextOptional
Set the TextOptional propertyIf true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.
- Parameters:
value- property wrapper value around Boolean
-
getIconTranslate
Get the IconTranslate propertyDistance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
- Returns:
- property wrapper value around Float[]
-
setIconTranslate
Set the IconTranslate propertyDistance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
- Parameters:
value- property wrapper value around Float[]
-
getIconTranslateAnchor
Get the IconTranslateAnchor propertyControls the frame of reference for
PropertyFactory.iconTranslate(java.lang.Float[]).- Returns:
- property wrapper value around String
-
setIconTranslateAnchor
Set the IconTranslateAnchor propertyControls the frame of reference for
PropertyFactory.iconTranslate(java.lang.Float[]).- Parameters:
value- property wrapper value around String
-
getTextTranslate
Get the TextTranslate propertyDistance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
- Returns:
- property wrapper value around Float[]
-
setTextTranslate
Set the TextTranslate propertyDistance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.
- Parameters:
value- property wrapper value around Float[]
-
getTextTranslateAnchor
Get the TextTranslateAnchor propertyControls the frame of reference for
PropertyFactory.textTranslate(java.lang.Float[]).- Returns:
- property wrapper value around String
-
setTextTranslateAnchor
Set the TextTranslateAnchor propertyControls the frame of reference for
PropertyFactory.textTranslate(java.lang.Float[]).- Parameters:
value- property wrapper value around String
-
setFilter
public void setFilter(@NonNull com.trimblemaps.mapsdk.style.expressions.Expression expression) Set filter on the managed symbols.- Parameters:
expression- expression
-
getFilter
@Nullable public com.trimblemaps.mapsdk.style.expressions.Expression getFilter()Get filter of the managed symbols.- Returns:
- expression
-