-
public abstract class AnnotationManager<L extends Layer, T extends Annotation, S extends Options<T>, D extends OnAnnotationDragListener<T>, U extends OnAnnotationClickListener<T>, V extends OnAnnotationLongClickListener<T>>Generic AnnotationManager, can be used to create annotation specific managers.
-
-
Field Summary
Fields Modifier and Type Field Description protected final LongSparseArray<T>annotationsprivate StringbelowLayerIdprivate StringaboveLayerId
-
Method Summary
Modifier and Type Method Description LongSparseArray<T>getAnnotations()Get a list of current annotations. StringgetBelowLayerId()StringgetAboveLayerId()StringgetLayerId()Returns a layer ID that annotations created by this manager are laid out on. Tcreate(S options)Create an annotation on the map List<T>create(List<S> optionsList)Create a list of annotations on the map. voiddelete(T annotation)Delete an annotation from the map. voiddelete(List<T> annotationList)Deletes annotations from the map. voiddeleteAll()Deletes all annotations from the map. voidupdate(T annotation)Update an annotation on the map. voidupdate(List<T> annotationList)Update annotations on the map. voidupdateSource()Trigger an update to the underlying source. voidaddDragListener(@NonNull() D d)Add a callback to be invoked when an annotation is dragged. voidremoveDragListener(@NonNull() D d)Remove a previously added callback that was to be invoked when an annotation has been dragged. voidaddClickListener(@NonNull() U u)Add a callback to be invoked when a symbol has been clicked. voidremoveClickListener(@NonNull() U u)Remove a previously added callback that was to be invoked when symbol has been clicked. voidaddLongClickListener(@NonNull() V v)Add a callback to be invoked when a symbol has been long clicked. voidremoveLongClickListener(@NonNull() V v)Remove a previously added callback that was to be invoked when symbol has been long clicked. voidonDestroy()Cleanup annotation manager, used to clear listeners -
-
Method Detail
-
getAnnotations
@UiThread() LongSparseArray<T> getAnnotations()
Get a list of current annotations.
-
getBelowLayerId
String getBelowLayerId()
-
getAboveLayerId
String getAboveLayerId()
-
getLayerId
String getLayerId()
Returns a layer ID that annotations created by this manager are laid out on.
This reference can be used together with addLayerAbove or addLayerBelow to improve other layers positioning in relation to this manager.
-
create
@UiThread() T create(S options)
Create an annotation on the map
- Parameters:
options- the annotation options defining the annotation to build
-
create
@UiThread() List<T> create(List<S> optionsList)
Create a list of annotations on the map.
- Parameters:
optionsList- the list of annotation options defining the list of annotations to build
-
delete
@UiThread() void delete(T annotation)
Delete an annotation from the map.
- Parameters:
annotation- annotation to be deleted
-
delete
@UiThread() void delete(List<T> annotationList)
Deletes annotations from the map.
- Parameters:
annotationList- the list of annotations to be deleted
-
update
@UiThread() void update(T annotation)
Update an annotation on the map.
- Parameters:
annotation- annotation to be updated
-
update
@UiThread() void update(List<T> annotationList)
Update annotations on the map.
- Parameters:
annotationList- list of annotation to be updated
-
updateSource
void updateSource()
Trigger an update to the underlying source. The update is delayed until afterthe next UI draw to batch multiple actions.
-
addDragListener
@UiThread() void addDragListener(@NonNull() D d)
Add a callback to be invoked when an annotation is dragged.
- Parameters:
d- the callback to be invoked when an annotation is dragged
-
removeDragListener
@UiThread() void removeDragListener(@NonNull() D d)
Remove a previously added callback that was to be invoked when an annotation has been dragged.
- Parameters:
d- the callback to be removed
-
addClickListener
@UiThread() void addClickListener(@NonNull() U u)
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
@UiThread() void removeClickListener(@NonNull() U u)
Remove a previously added callback that was to be invoked when symbol has been clicked.
- Parameters:
u- the callback to be removed
-
addLongClickListener
@UiThread() void addLongClickListener(@NonNull() V v)
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
@UiThread() void removeLongClickListener(@NonNull() V v)
Remove a previously added callback that was to be invoked when symbol has been long clicked.
- Parameters:
v- the callback to be removed
-
-
-
-