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 annotation
S - type of options for building the annotation, depends on generic T
D - type of annotation drag listener, depends on generic T
U - type of annotation click listener, depends on generic T
V - 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
    Modifier and Type
    Field
    Description
    protected final androidx.collection.LongSparseArray<T>
     
    protected L
     
    protected final com.trimblemaps.mapsdk.maps.TrimbleMapsMap
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    void
    Add a callback to be invoked when a symbol has been clicked.
    void
    Add a callback to be invoked when an annotation is dragged.
    void
    Add a callback to be invoked when a symbol has been long clicked.
    create(List<S> optionsList)
    Create a list of annotations on the map.
    create(S options)
    Create an annotation on the map
    void
    delete(List<T> annotationList)
    Deletes annotations from the map.
    void
    delete(T annotation)
    Delete an annotation from the map.
    void
    Deletes 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.
    void
    Cleanup annotation manager, used to clear listeners
    void
    Remove a previously added callback that was to be invoked when symbol has been clicked.
    void
    Remove a previously added callback that was to be invoked when an annotation has been dragged.
    void
    Remove a previously added callback that was to be invoked when symbol has been long clicked.
    protected abstract void
     
    void
    update(List<T> annotationList)
    Update annotations on the map.
    void
    update(T annotation)
    Update an annotation on the map.
    void
    Trigger an update to the underlying source

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • trimbleMapsMap

      protected final com.trimblemaps.mapsdk.maps.TrimbleMapsMap trimbleMapsMap
    • annotations

      protected final androidx.collection.LongSparseArray<T extends Annotation> annotations
    • layer

      protected L extends com.trimblemaps.mapsdk.style.layers.Layer 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

      public String getLayerId()
      Returns a layer ID that annotations created by this manager are laid out on. This reference can be used together with Style.addLayerAbove(Layer, String) or Style.addLayerBelow(Layer, String) to improve other layers positioning in relation to this manager.
      Returns:
      underlying layer's ID
    • getAnnotations

      @UiThread public androidx.collection.LongSparseArray<T> getAnnotations()
      Get a list of current annotations.
      Returns:
      long sparse array of annotations
    • create

      @UiThread public T create(S options)
      Create an annotation on the map
      Parameters:
      options - the annotation options defining the annotation to build
      Returns:
      the build annotation
    • create

      @UiThread public 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
      Returns:
      the list of build annotations
    • delete

      @UiThread public void delete(T annotation)
      Delete an annotation from the map.
      Parameters:
      annotation - annotation to be deleted
    • delete

      @UiThread public void delete(List<T> annotationList)
      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

      @UiThread public void update(T annotation)
      Update an annotation on the map.
      Parameters:
      annotation - annotation to be updated
    • update

      @UiThread public void update(List<T> annotationList)
      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

      protected abstract void setDataDrivenPropertyIsUsed(@NonNull String property)
    • addDragListener

      @UiThread public 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 public 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 public 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 public 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 public 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 public 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
    • onDestroy

      @UiThread public void onDestroy()
      Cleanup annotation manager, used to clear listeners