Class Marker

Direct Known Subclasses:
ClusteredMarker, FlatPlacemarkMarker, HighlightedMarkers, LocationMarker, OverlayMarker, PlacemarkMarker, SelectedPinMarker, TagMarker

public abstract class Marker extends TextureProvider
A class to encapsulate graphical and positioning information for bitmaps to be displayed on the MapView.
  • Constructor Details

    • Marker

      protected Marker(float positionX, float positionY)
      Constructs a Marker with at the given position.
      Parameters:
      positionX - The x position of this markers anchor.
      positionY - The y position of this markers anchor.
    • Marker

      protected Marker(float positionX, float positionY, float anchorX, float anchorY)
      Constructs a Marker with anchors.
      Parameters:
      positionX - The x position of this markers anchor.
      positionY - The y position of this markers anchor.
      anchorX - The x position of the anchor within this marker [0.0:1.0]
      anchorY - The y position of the anchor within this marker [0.0:1.0]
    • Marker

      protected Marker(float positionX, float positionY, float anchorX, float anchorY, float weight)
      Constructs a Marker with anchors and a weight.
      Parameters:
      positionX - The x position of this markers anchor.
      positionY - The y position of this markers anchor.
      anchorX - The x position of the anchor within this marker [0.0:1.0]
      anchorY - The y position of the anchor within this marker [0.0:1.0]
      weight - The weight of this marker, weight is used as a multiplier when sorting markers during collision tests.
  • Method Details

    • canBeSelected

      public boolean canBeSelected()
      If a marker can be selected, when a user taps on it a callout panel will be shown and a pin will be placed on top of the marker.

      It’s true by default. Override to change this behavior.

      Returns:
      true if the marker can be selected, false if it cannot
    • showsPinMarker

      public boolean showsPinMarker()
      If a marker can be selected, this will determine if a pin marker will be placed on top of it when the user selects it.
      Returns:
      true if we want to show a pin marker on top the marker, false otherwise
    • setListener

      public void setListener(Marker.MarkerListener listener)
      Sets the listener for this marker.
    • setAnchor

      public void setAnchor(float anchorX, float anchorY)
      Sets the anchor point of this marker.
      Parameters:
      anchorX - A value between 0 and 1, with 0.5 being the horizontal center of this markers bitmap.
      anchorY - A value between 0 and 1, with 0.5 being the vertical center of this markers bitmap.
    • setPosition

      public void setPosition(float positionX, float positionY)
      Sets the pixel position of this markers anchor.
    • setWeight

      public void setWeight(float weight)
      Sets the weight of this marker, the weight is used in sorting the results of collision tests.

      Higher weight values with show up on top of lower values.

    • getWeight

      public float getWeight()
      Get weight of this Marker.
    • getAnchor

      public float[] getAnchor()
      Get anchor for this Marker.
      Returns:
      An array of two floats anchorX and anchorY.
    • getPosition

      public float[] getPosition()
      Get the pixel position of this marker.
      Returns:
      An array of two floats positionX and positionY.
    • getName

      public String getName()
      Get the name of this marker.
    • setName

      public void setName(String name)
      Set the name of this marker.
    • getDetails

      public String getDetails()
      Get the details of this marker.

      Second line of text in the callout

    • setDetails

      public void setDetails(String details)
      Set the details of this marker.
    • getCalloutTitle

      public String getCalloutTitle()
      Title text to show on the callout panel
    • getCalloutDetails

      public String getCalloutDetails()
      Detail text to show on the callout panel
    • showsCallout

      public boolean showsCallout()
      Returns:
      True if the Marker should display a callout automatically when tapped.
    • setShowsCallout

      public void setShowsCallout(boolean showsCallout)
      Set if this marker should display a callout when tapped.
    • getCollision

      public boolean getCollision()
      Returns:
      True if the Marker is included in collision checking and not drawn when another higher weight marker occludes it.
    • setCollision

      public void setCollision(boolean allowCollision)
      Set if the Marker is included in collision checking and not drawn when another higher weight marker occludes it.
    • getCollisionCondition

      public Marker.CollisionType getCollisionCondition()
      Function used to get what type of collision is used by highlighted marker for clustering.

      Currently only equal weight is supported. Default is no clustering.

      Returns:
      the type of collision that triggers clustering for highlighted markers
    • setCollisionCondition

      public void setCollisionCondition(Marker.CollisionType newCollisionCondition)
      Set if the Marker allows collision with identical weight markers (currently used for HighlightedMarkers only).
    • getMaxZoomLevel

      public MapInfo.ZoomLevel getMaxZoomLevel()
      The maximum zoom level that this Marker should be visible.
    • setMaxZoomLevel

      public void setMaxZoomLevel(MapInfo.ZoomLevel maxZoomLevel)
      Sets the maximum zoom level that this Marker should be visible.
    • getMinZoomLevel

      public MapInfo.ZoomLevel getMinZoomLevel()
      The minimum zoom level that this Marker should be visible.
    • setMinZoomLevel

      public void setMinZoomLevel(MapInfo.ZoomLevel minZoomLevel)
      The minimum zoom level that this Marker should be visible.
    • setRotationFixedToMap

      public void setRotationFixedToMap(boolean rotationFixedToMap)
      Set if the Marker’s rotation is fixed to the map.
    • getRotationFixedToMap

      public boolean getRotationFixedToMap()
      Returns:
      True if the markers rotation is fixed to the rotation of the map, False if the markers rotation is fixed to the view.
    • setScaleFixedToMap

      public void setScaleFixedToMap(boolean scaleFixedToMap)
      Set if the Marker’s scale is fixed to the map.
    • getScaleFixedToMap

      public boolean getScaleFixedToMap()
      Returns:
      True if the markers scale is fixed to the scale of the map, False if the markers scale is fixed to the view.
    • getXScale

      public float getXScale()
      Returns:
      The scale modifier of the Marker in the x coordinate.
    • setXScale

      public void setXScale(float scale)
      Set if the scale modifier of the Marker in the x coordinate.
    • getYScale

      public float getYScale()
      Returns:
      The scale modifier of the Marker in the y coordinate.
    • setYScale

      public void setYScale(float scale)
      Set if the scale modifier of the Marker in the y coordinate.
    • getAlpha

      public float getAlpha()
      Returns:
      The alpha modifier of the Marker.
    • setAlpha

      public void setAlpha(float alpha)
      Set if the alpha modifier of the Marker, 0.0 to 1.0 where 0 is transparent and 1 is opaque.
    • isDisabled

      public boolean isDisabled()
      Returns true if the marker is disabled.
    • setDisabled

      public void setDisabled(boolean disabled)
      Sets if the marker is disabled.
    • isDragDropEnabled

      public boolean isDragDropEnabled()
      Returns true if drag and drop for this the marker is enabled.
    • setDragDropEnabled

      public void setDragDropEnabled(boolean enabled)
      Sets if drag and drop for this the marker is enabled.
    • onTapped

      public void onTapped()
      Called to indicate that this marker has been tapped by the user.
    • invalidate

      public void invalidate()
      Called to indicate that this Marker has been updated.
    • invalidate

      public void invalidate(boolean invalidateBitmap)
      Called to indicate that this Marker has been updated.
      Parameters:
      invalidateBitmap - True if the bitmap needs to be updated as well as the properties.
    • getDropShadowBitmap

      public Bitmap getDropShadowBitmap()
      Gets the bitmap to be used as the drop shadow.

      Override to use a custom drop shadow.