Class Annotation<T extends com.trimblemaps.geojson.Geometry>

java.lang.Object
com.trimblemaps.mapsdk.plugins.annotation.Annotation<T>
Direct Known Subclasses:
Circle, Fill, Line, Symbol

public abstract class Annotation<T extends com.trimblemaps.geojson.Geometry> extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected T
     
    protected com.google.gson.JsonObject
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    com.google.gson.JsonElement
    Get the arbitrary json object data of the annotation.
    Get the geometry of an annotation, type of geometry returned depends on the generic attribute.
    long
    Returns this annotation's internal ID.
    int
     
    boolean
    Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.
    void
    setData(com.google.gson.JsonElement jsonElement)
    Set the arbitrary json data of the annotation.
    void
    setDraggable(boolean draggable)
    Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.
    void
    setGeometry(T geometry)
    Set the geometry of an annotation, geometry type depends on the generic attribute.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • jsonObject

      protected com.google.gson.JsonObject jsonObject
    • geometry

      protected T extends com.trimblemaps.geojson.Geometry geometry
  • Method Details

    • setGeometry

      public void setGeometry(T geometry)
      Set the geometry of an annotation, geometry type depends on the generic attribute.
      Parameters:
      geometry - an instance of a geometry type
    • getGeometry

      public T getGeometry()
      Get the geometry of an annotation, type of geometry returned depends on the generic attribute.
      Returns:
      the geometry of the annotation
      Throws:
      IllegalStateException - if geometry hasn't been initialised
    • getId

      public long getId()
      Returns this annotation's internal ID.
      Returns:
      annotation's internal ID
    • isDraggable

      public boolean isDraggable()
      Returns whether this annotation is draggable, meaning it can be dragged across the screen when touched and moved.
      Returns:
      draggable when touched
    • setDraggable

      public void setDraggable(boolean draggable)
      Set whether this annotation should be draggable, meaning it can be dragged across the screen when touched and moved.
      Parameters:
      draggable - should be draggable
    • setData

      public void setData(@Nullable com.google.gson.JsonElement jsonElement)
      Set the arbitrary json data of the annotation.
      Parameters:
      jsonElement - the arbitrary json object data
    • getData

      @Nullable public com.google.gson.JsonElement getData()
      Get the arbitrary json object data of the annotation.
      Returns:
      the arbitrary json object data if set, else null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object