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
AMarkerdraws aBitmapat 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 booleancontains(org.mapsforge.core.model.Point center, org.mapsforge.core.model.Point point)voiddraw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)Draws thisLayeron the given canvas.org.mapsforge.core.graphics.BitmapgetBitmap()intgetHorizontalOffset()org.mapsforge.core.model.LatLonggetLatLong()org.mapsforge.core.model.LatLonggetPosition()Gets the geographic position of this layer element, if it exists.intgetVerticalOffset()voidonDestroy()voidsetBitmap(org.mapsforge.core.graphics.Bitmap bitmap)voidsetHorizontalOffset(int horizontalOffset)voidsetLatLong(org.mapsforge.core.model.LatLong latLong)voidsetVerticalOffset(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 initialBitmapof 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:LayerDraws thisLayeron the given canvas.- Specified by:
drawin classLayer- Parameters:
boundingBox- the geographical area which should be drawn.zoomLevel- the zoom level at which thisLayershould draw itself.canvas- the canvas on which thisLayershould 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
Bitmapof 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:LayerGets the geographic position of this layer element, if it exists. The default implementation of this method returns null.- Overrides:
getPositionin 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 newBitmapof 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.
-
-