Class AnnotationManager<L extends com.trimblemaps.mapsdk.style.layers.Layer,T extends Annotation,S extends Options<T>,D extends OnAnnotationDragListener<T>,U extends OnAnnotationClickListener<T>,V extends OnAnnotationLongClickListener<T>>
java.lang.Object
com.trimblemaps.mapsdk.plugins.annotation.AnnotationManager<L,T,S,D,U,V>
- Type Parameters:
T- type of annotationS- type of options for building the annotation, depends on generic TD- type of annotation drag listener, depends on generic TU- type of annotation click listener, depends on generic TV- type of annotation long click listener, depends on generic T
- Direct Known Subclasses:
CircleManager,FillManager,LineManager,SymbolManager
public abstract class AnnotationManager<L extends com.trimblemaps.mapsdk.style.layers.Layer,T extends Annotation,S extends Options<T>,D extends OnAnnotationDragListener<T>,U extends OnAnnotationClickListener<T>,V extends OnAnnotationLongClickListener<T>> extends Object
Generic AnnotationManager, can be used to create annotation specific managers.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnnotationManager(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, com.trimblemaps.mapsdk.maps.Style style, com.trimblemaps.mapsdk.plugins.annotation.CoreElementProvider<L> coreElementProvider, com.trimblemaps.mapsdk.plugins.annotation.DraggableAnnotationController draggableAnnotationController, String belowLayerId, com.trimblemaps.mapsdk.style.sources.GeoJsonOptions geoJsonOptions) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a callback to be invoked when a symbol has been clicked.voidaddDragListener(D d) Add a callback to be invoked when an annotation is dragged.voidAdd a callback to be invoked when a symbol has been long clicked.Create a list of annotations on the map.Create an annotation on the mapvoidDeletes annotations from the map.voidDelete an annotation from the map.voidDeletes all annotations from the map.androidx.collection.LongSparseArray<T> Get a list of current annotations.Returns a layer ID that annotations created by this manager are laid out on.voidCleanup annotation manager, used to clear listenersvoidRemove a previously added callback that was to be invoked when symbol has been clicked.voidRemove a previously added callback that was to be invoked when an annotation has been dragged.voidRemove a previously added callback that was to be invoked when symbol has been long clicked.protected abstract voidsetDataDrivenPropertyIsUsed(String property) voidUpdate annotations on the map.voidUpdate an annotation on the map.voidTrigger an update to the underlying source
-
Field Details
-
trimbleMapsMap
protected final com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap -
annotations
-
layer
-
-
Constructor Details
-
AnnotationManager
@UiThread protected AnnotationManager(com.trimblemaps.mapsdk.maps.MapView mapView, com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap, com.trimblemaps.mapsdk.maps.Style style, com.trimblemaps.mapsdk.plugins.annotation.CoreElementProvider<L> coreElementProvider, com.trimblemaps.mapsdk.plugins.annotation.DraggableAnnotationController draggableAnnotationController, String belowLayerId, com.trimblemaps.mapsdk.style.sources.GeoJsonOptions geoJsonOptions)
-
-
Method Details
-
getLayerId
Returns a layer ID that annotations created by this manager are laid out on. This reference can be used together withStyle.addLayerAbove(Layer, String)orStyle.addLayerBelow(Layer, String)to improve other layers positioning in relation to this manager.- Returns:
- underlying layer's ID
-
getAnnotations
Get a list of current annotations.- Returns:
- long sparse array of annotations
-
create
Create an annotation on the map- Parameters:
options- the annotation options defining the annotation to build- Returns:
- the build annotation
-
create
Create a list of annotations on the map.- Parameters:
optionsList- the list of annotation options defining the list of annotations to build- Returns:
- the list of build annotations
-
delete
Delete an annotation from the map.- Parameters:
annotation- annotation to be deleted
-
delete
Deletes annotations from the map.- Parameters:
annotationList- the list of annotations to be deleted
-
deleteAll
@UiThread public void deleteAll()Deletes all annotations from the map. -
update
Update an annotation on the map.- Parameters:
annotation- annotation to be updated
-
update
Update annotations on the map.- Parameters:
annotationList- list of annotation to be updated
-
updateSource
public void updateSource()Trigger an update to the underlying source -
setDataDrivenPropertyIsUsed
-
addDragListener
Add a callback to be invoked when an annotation is dragged.- Parameters:
d- the callback to be invoked when an annotation is dragged
-
removeDragListener
Remove a previously added callback that was to be invoked when an annotation has been dragged.- Parameters:
d- the callback to be removed
-
addClickListener
Add a callback to be invoked when a symbol has been clicked.- Parameters:
u- the callback to be invoked when a symbol is clicked
-
removeClickListener
Remove a previously added callback that was to be invoked when symbol has been clicked.- Parameters:
u- the callback to be removed
-
addLongClickListener
Add a callback to be invoked when a symbol has been long clicked.- Parameters:
v- the callback to be invoked when a symbol is clicked
-
removeLongClickListener
Remove a previously added callback that was to be invoked when symbol has been long clicked.- Parameters:
v- the callback to be removed
-
onDestroy
@UiThread public void onDestroy()Cleanup annotation manager, used to clear listeners
-