public class Polyline extends Layer
Polyline
draws a connected series of line segments specified by a list of LatLongs
.
A Polyline
holds a Paint
object which defines drawing parameters such as color, stroke width, pattern
and transparency.displayModel
Constructor and Description |
---|
Polyline(org.mapsforge.core.graphics.Paint paintStroke,
org.mapsforge.core.graphics.GraphicFactory graphicFactory) |
Polyline(org.mapsforge.core.graphics.Paint paintStroke,
org.mapsforge.core.graphics.GraphicFactory graphicFactory,
boolean keepAligned) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(org.mapsforge.core.model.Point tapXY,
MapViewProjection mapViewProjection) |
void |
draw(org.mapsforge.core.model.BoundingBox boundingBox,
byte zoomLevel,
org.mapsforge.core.graphics.Canvas canvas,
org.mapsforge.core.model.Point topLeftPoint)
Draws this
Layer on the given canvas. |
java.util.List<org.mapsforge.core.model.LatLong> |
getLatLongs() |
org.mapsforge.core.graphics.Paint |
getPaintStroke() |
boolean |
isKeepAligned() |
void |
setPaintStroke(org.mapsforge.core.graphics.Paint paintStroke) |
getDisplayModel, getPosition, isVisible, onAdd, onDestroy, onLongPress, onRemove, onTap, requestRedraw, setDisplayModel, setVisible, setVisible
public Polyline(org.mapsforge.core.graphics.Paint paintStroke, org.mapsforge.core.graphics.GraphicFactory graphicFactory)
paintStroke
- the initial Paint
used to stroke this polyline (may be null).graphicFactory
- the GraphicFactorypublic Polyline(org.mapsforge.core.graphics.Paint paintStroke, org.mapsforge.core.graphics.GraphicFactory graphicFactory, boolean keepAligned)
paintStroke
- the initial Paint
used to stroke this polyline (may be null).graphicFactory
- the GraphicFactorykeepAligned
- if set to true it will keep the bitmap aligned with the map,
to avoid a moving effect of a bitmap shader.public boolean contains(org.mapsforge.core.model.Point tapXY, MapViewProjection mapViewProjection)
public void draw(org.mapsforge.core.model.BoundingBox boundingBox, byte zoomLevel, org.mapsforge.core.graphics.Canvas canvas, org.mapsforge.core.model.Point topLeftPoint)
Layer
Layer
on the given canvas.draw
in class Layer
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.public java.util.List<org.mapsforge.core.model.LatLong> getLatLongs()
public org.mapsforge.core.graphics.Paint getPaintStroke()
Paint
used to stroke this polyline (may be null).public boolean isKeepAligned()
public void setPaintStroke(org.mapsforge.core.graphics.Paint paintStroke)
paintStroke
- the new Paint
used to stroke this polyline (may be null).