Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class Polyline
A connected sequence of line segments drawn on a map. Add one through
MapSurface.addPolyline(Polyline).
A polyline joins the vertices you give it with straight segments; it
knows nothing about roads. To draw a route that follows the road network,
ask a routing service for the road geometry and draw that – see
Routing, or decode a geometry you fetched
yourself with fromEncoded(String).
Constructors
public Polyline() | Creates an empty polyline; append vertices with addPoint(LatLng). |
public Polyline(LatLng[] pts) | Creates a polyline through the supplied vertices (defensively copied). |
Methods
Inherited methods
Constructor details
Polyline
public Polyline()addPoint(LatLng).Polyline
public Polyline(LatLng[] pts)Method details
fromEncoded
public static Polyline fromEncoded(String encoded)PolylineCodec’s default precision – the shape virtually every
directions API returns for a route.fromEncoded
public static Polyline fromEncoded(String encoded, int precision)Creates a polyline from an encoded polyline geometry at an explicit
decimal precision (5 for the classic format, 6 for polyline6).
Throws IllegalArgumentException when precision falls outside 1 to
10; a precision that cannot scale coordinates sensibly would otherwise
decode into a line drawn in the wrong place. See PolylineCodec.
addPoint
public Polyline addPoint(LatLng point)getPoints
public List getPoints()LatLng).getStrokeColor
public int getStrokeColor()setStrokeColor
public Polyline setStrokeColor(int strokeColor)getStrokeWidth
public int getStrokeWidth()setStrokeWidth
public Polyline setStrokeWidth(int strokeWidth)getStrokeAlpha
public int getStrokeAlpha()setStrokeAlpha
public Polyline setStrokeAlpha(int strokeAlpha)isVisible
public boolean isVisible()setVisible
public Polyline setVisible(boolean visible)