Class Marker


  • public class Marker
    extends Layer
    A Marker draws a Bitmap at a given geographical position.
    • Constructor Detail

      • Marker

        public Marker​(org.mapsforge.core.model.LatLong latLong,
                      org.mapsforge.core.graphics.Bitmap bitmap,
                      int horizontalOffset,
                      int verticalOffset)
        Parameters:
        latLong - the initial geographical coordinates of this marker (may be null).
        bitmap - the initial Bitmap of this marker (may be null).
        horizontalOffset - the horizontal marker offset.
        verticalOffset - the vertical marker offset.
    • Method Detail

      • contains

        public boolean contains​(org.mapsforge.core.model.Point center,
                                org.mapsforge.core.model.Point point)
      • draw

        public void draw​(org.mapsforge.core.model.BoundingBox boundingBox,
                         byte zoomLevel,
                         org.mapsforge.core.graphics.Canvas canvas,
                         org.mapsforge.core.model.Point topLeftPoint)
        Description copied from class: Layer
        Draws this Layer on the given canvas.
        Specified by:
        draw in class Layer
        Parameters:
        boundingBox - the geographical area which should be drawn.
        zoomLevel - the zoom level at which this Layer should draw itself.
        canvas - the canvas on which this Layer should draw itself.
        topLeftPoint - the top-left pixel position of the canvas relative to the top-left map position.
      • getBitmap

        public org.mapsforge.core.graphics.Bitmap getBitmap()
        Returns:
        the Bitmap of this marker (may be null).
      • getHorizontalOffset

        public int getHorizontalOffset()
        Returns:
        the horizontal offset of this marker.
      • getLatLong

        public org.mapsforge.core.model.LatLong getLatLong()
        Returns:
        the geographical coordinates of this marker (may be null).
      • getPosition

        public org.mapsforge.core.model.LatLong getPosition()
        Description copied from class: Layer
        Gets the geographic position of this layer element, if it exists.

        The default implementation of this method returns null.

        Overrides:
        getPosition in class Layer
        Returns:
        Gets the LatLong Position of the Object
      • getVerticalOffset

        public int getVerticalOffset()
        Returns:
        the vertical offset of this marker.
      • onDestroy

        public void onDestroy()
        Overrides:
        onDestroy in class Layer
      • setBitmap

        public void setBitmap​(org.mapsforge.core.graphics.Bitmap bitmap)
        Parameters:
        bitmap - the new Bitmap of this marker (may be null).
      • setHorizontalOffset

        public void setHorizontalOffset​(int horizontalOffset)
        Parameters:
        horizontalOffset - the new horizontal offset of this marker.
      • setLatLong

        public void setLatLong​(org.mapsforge.core.model.LatLong latLong)
        Parameters:
        latLong - the new geographical coordinates of this marker (may be null).
      • setVerticalOffset

        public void setVerticalOffset​(int verticalOffset)
        Parameters:
        verticalOffset - the new vertical offset of this marker.