Package org.mapsforge.map.layer.overlay
Class Marker
- java.lang.Object
-
- org.mapsforge.map.layer.Layer
-
- org.mapsforge.map.layer.overlay.Marker
-
public class Marker extends Layer
AMarker
draws aBitmap
at a given geographical position.
-
-
Field Summary
-
Fields inherited from class org.mapsforge.map.layer.Layer
displayModel
-
-
Constructor Summary
Constructors Constructor Description Marker(org.mapsforge.core.model.LatLong latLong, org.mapsforge.core.graphics.Bitmap bitmap, int horizontalOffset, int verticalOffset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(org.mapsforge.core.model.Point center, org.mapsforge.core.model.Point point)
void
draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
Draws thisLayer
on the given canvas.org.mapsforge.core.graphics.Bitmap
getBitmap()
int
getHorizontalOffset()
org.mapsforge.core.model.LatLong
getLatLong()
org.mapsforge.core.model.LatLong
getPosition()
Gets the geographic position of this layer element, if it exists.int
getVerticalOffset()
void
onDestroy()
void
setBitmap(org.mapsforge.core.graphics.Bitmap bitmap)
void
setHorizontalOffset(int horizontalOffset)
void
setLatLong(org.mapsforge.core.model.LatLong latLong)
void
setVerticalOffset(int verticalOffset)
-
Methods inherited from class org.mapsforge.map.layer.Layer
getDisplayModel, isVisible, onAdd, onLongPress, onRemove, onScroll, onTap, requestRedraw, setDisplayModel, setVisible, setVisible
-
-
-
-
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 initialBitmap
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 thisLayer
on the given canvas.- Specified by:
draw
in classLayer
- Parameters:
boundingBox
- the geographical area which should be drawn.zoomLevel
- the zoom level at which thisLayer
should draw itself.canvas
- the canvas on which thisLayer
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 classLayer
- Returns:
- Gets the LatLong Position of the Object
-
getVerticalOffset
public int getVerticalOffset()
- Returns:
- the vertical offset of this marker.
-
setBitmap
public void setBitmap(org.mapsforge.core.graphics.Bitmap bitmap)
- Parameters:
bitmap
- the newBitmap
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.
-
-