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 Tpublic 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>>
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected <any> |
annotations |
protected L |
layer |
protected MapboxMap |
mapboxMap |
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotationManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
com.mapbox.mapboxsdk.plugins.annotation.CoreElementProvider<L> coreElementProvider,
com.mapbox.mapboxsdk.plugins.annotation.DraggableAnnotationController draggableAnnotationController,
java.lang.String belowLayerId,
GeoJsonOptions geoJsonOptions) |
| Modifier and Type | Method and Description |
|---|---|
void |
addClickListener(U u)
Add a callback to be invoked when a symbol has been clicked.
|
void |
addDragListener(D d)
Add a callback to be invoked when an annotation is dragged.
|
void |
addLongClickListener(V v)
Add a callback to be invoked when a symbol has been long clicked.
|
java.util.List<T> |
create(java.util.List<S> optionsList)
Create a list of annotations on the map.
|
T |
create(S options)
Create an annotation on the map
|
void |
delete(java.util.List<T> annotationList)
Deletes annotations from the map.
|
void |
delete(T annotation)
Delete an annotation from the map.
|
void |
deleteAll()
Deletes all annotations from the map.
|
<any> |
getAnnotations()
Get a list of current annotations.
|
java.lang.String |
getLayerId()
Returns a layer ID that annotations created by this manager are laid out on.
|
void |
onDestroy()
Cleanup annotation manager, used to clear listeners
|
void |
removeClickListener(U u)
Remove a previously added callback that was to be invoked when symbol has been clicked.
|
void |
removeDragListener(D d)
Remove a previously added callback that was to be invoked when an annotation has been dragged.
|
void |
removeLongClickListener(V v)
Remove a previously added callback that was to be invoked when symbol has been long clicked.
|
protected abstract void |
setDataDrivenPropertyIsUsed(java.lang.String property) |
void |
update(java.util.List<T> annotationList)
Update annotations on the map.
|
void |
update(T annotation)
Update an annotation on the map.
|
void |
updateSource()
Trigger an update to the underlying source
|
protected final MapboxMap mapboxMap
protected final <any> annotations
protected L extends Layer layer
protected AnnotationManager(MapView mapView,
MapboxMap mapboxMap,
Style style,
com.mapbox.mapboxsdk.plugins.annotation.CoreElementProvider<L> coreElementProvider,
com.mapbox.mapboxsdk.plugins.annotation.DraggableAnnotationController draggableAnnotationController,
java.lang.String belowLayerId,
GeoJsonOptions geoJsonOptions)
public java.lang.String getLayerId()
Style#addLayerAbove(Layer, String)
or Style#addLayerBelow(Layer, String) to improve other layers positioning in relation to this manager.public <any> getAnnotations()
public T create(S options)
options - the annotation options defining the annotation to buildpublic java.util.List<T> create(java.util.List<S> optionsList)
optionsList - the list of annotation options defining the list of annotations to buildpublic void delete(T annotation)
annotation - annotation to be deletedpublic void delete(java.util.List<T> annotationList)
annotationList - the list of annotations to be deletedpublic void deleteAll()
public void update(T annotation)
annotation - annotation to be updatedpublic void update(java.util.List<T> annotationList)
annotationList - list of annotation to be updatedpublic void updateSource()
protected abstract void setDataDrivenPropertyIsUsed(java.lang.String property)
public void addDragListener(D d)
d - the callback to be invoked when an annotation is draggedpublic void removeDragListener(D d)
d - the callback to be removedpublic void addClickListener(U u)
u - the callback to be invoked when a symbol is clickedpublic void removeClickListener(U u)
u - the callback to be removedpublic void addLongClickListener(V v)
v - the callback to be invoked when a symbol is clickedpublic void removeLongClickListener(V v)
v - the callback to be removedpublic void onDestroy()
© 2015–2019 Mapbox. All rights reserved.