Class Marker

java.lang.Object
com.trimblemaps.mapsdk.annotations.Annotation
com.trimblemaps.mapsdk.annotations.Marker
All Implemented Interfaces:
Comparable<Annotation>

@Deprecated public class Marker extends Annotation
Deprecated.
Use TrimbleMaps Annotation Plugin instead
Marker is an annotation that shows an icon image at a geographical location. The default marker uses a provided icon. This icon can be customized using IconFactory to generate an Icon using a provided image. Markers are added to the map by first giving a LatLng and using TrimbleMapsMap.addMarker(MarkerOptions). The marker icon will be centered at this position so it is common to add padding to the icon image before usage.

Markers are designed to be interactive. They receive click events by default, and are often used with event listeners to bring up info windows. An InfoWindow is displayed by default when either a title or snippet is provided.

  • Constructor Details

    • Marker

      public Marker(BaseMarkerOptions baseMarkerOptions)
      Deprecated.
      Creates a instance of Marker using the builder of Marker.
      Parameters:
      baseMarkerOptions - The builder used to construct the Marker.
  • Method Details

    • getPosition

      public com.trimblemaps.mapsdk.geometry.LatLng getPosition()
      Deprecated.
      Returns the position of the marker.
      Returns:
      A LatLng object specifying the marker's current position.
    • getSnippet

      public String getSnippet()
      Deprecated.
      Gets the snippet of the marker.
      Returns:
      A string containing the marker's snippet.
    • getTitle

      public String getTitle()
      Deprecated.
      Gets the snippet of the marker.
      Returns:
      A string containing the marker's snippet.
    • hideInfoWindow

      public void hideInfoWindow()
      Deprecated.
      Do not use this method, used internally by the SDK.
    • isInfoWindowShown

      public boolean isInfoWindowShown()
      Deprecated.
      Do not use this method, used internally by the SDK.
      Returns:
      true if the infoWindow is shown
    • setPosition

      public void setPosition(com.trimblemaps.mapsdk.geometry.LatLng position)
      Deprecated.
      Sets the location of the marker.
      Parameters:
      position - A LatLng defining the marker position.
    • setSnippet

      public void setSnippet(String snippet)
      Deprecated.
      Sets the snippet of the marker.
      Parameters:
      snippet - A String used in the marker info window. If null, the snippet is cleared.
    • setIcon

      public void setIcon(@Nullable Icon icon)
      Deprecated.
      Sets the icon of the marker.
      Parameters:
      icon - The Icon to be used as Marker image
    • getIcon

      @Nullable public Icon getIcon()
      Deprecated.
      Gets the Icon currently used for the marker. If no Icon was set for the marker, the default icon will be returned.
      Returns:
      The Icon the marker is using.
    • setTitle

      public void setTitle(String title)
      Deprecated.
      Sets the title of the marker.
      Parameters:
      title - A String used in the marker info window. If null, the title is cleared.
    • getInfoWindow

      @Nullable public InfoWindow getInfoWindow()
      Deprecated.
      Gets the InfoWindow the marker is using. If the marker hasn't had an info window defined, this will return null.
      Returns:
      The info window the marker is using.
    • showInfoWindow

      @Nullable public InfoWindow showInfoWindow(@NonNull TrimbleMapsMap trimbleMapsMap, @NonNull MapView mapView)
      Deprecated.
      Do not use this method, used internally by the SDK. Use TrimbleMapsMap.selectMarker(Marker) if you want to programmatically display the markers info window.
      Parameters:
      trimbleMapsMap - The hosting TrimbleMapsMap.
      mapView - The hosting map view.
      Returns:
      The info window that was shown.
    • setTopOffsetPixels

      public void setTopOffsetPixels(int topOffsetPixels)
      Deprecated.
      Do not use this method, used internally by the SDK.
      Parameters:
      topOffsetPixels - the top offset pixels.
    • setRightOffsetPixels

      public void setRightOffsetPixels(int rightOffsetPixels)
      Deprecated.
      Do not use this method, used internally by the SDK.
      Parameters:
      rightOffsetPixels - the right offset pixels.
    • toString

      public String toString()
      Deprecated.
      Returns a String with the marker position.
      Overrides:
      toString in class Object
      Returns:
      A String with the marker position.