# Class Polyline

java.lang.Object
com.codename1.maps.MapObject
com.codename1.maps.Polyline

public final class Polyline extends MapObject
A connected sequence of line segments drawn on a map. Add one through `MapSurface.addPolyline(Polyline)`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Polyline()`
  Creates an empty polyline; append vertices with `addPoint(LatLng)`.
  `Polyline(LatLng[] pts)`
  Creates a polyline through the supplied vertices (defensively copied).

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Polyline`
  `addPoint(LatLng point)`
  Appends a vertex.
  `List`
  `getPoints()`
  The live list of vertices (`LatLng`).
  `int`
  `getStrokeAlpha()`
  The stroke opacity in [0,255].
  `int`
  `getStrokeColor()`
  The stroke color as 0xRRGGBB.
  `int`
  `getStrokeWidth()`
  The stroke width in pixels.
  `boolean`
  `isVisible()`
  Whether the polyline is rendered.
  `Polyline`
  `setStrokeAlpha(int strokeAlpha)`
  Sets the stroke opacity in [0,255].
  `Polyline`
  `setStrokeColor(int strokeColor)`
  Sets the stroke color as 0xRRGGBB.
  `Polyline`
  `setStrokeWidth(int strokeWidth)`
  Sets the stroke width in pixels.
  `Polyline`
  `setVisible(boolean visible)`
  Shows or hides the polyline.

  ### Methods inherited from class MapObject

  `equals, getId, hashCode`

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Polyline

    public Polyline()
    Creates an empty polyline; append vertices with `addPoint(LatLng)`.

  - ### Polyline

    public Polyline(LatLng[] pts)
    Creates a polyline through the supplied vertices (defensively copied).

- ## Method Details

  - ### addPoint

    public Polyline addPoint(LatLng point)
    Appends a vertex.

  - ### getPoints

    public List getPoints()
    The live list of vertices (`LatLng`).

  - ### getStrokeColor

    public int getStrokeColor()
    The stroke color as 0xRRGGBB.

  - ### setStrokeColor

    public Polyline setStrokeColor(int strokeColor)
    Sets the stroke color as 0xRRGGBB.

  - ### getStrokeWidth

    public int getStrokeWidth()
    The stroke width in pixels.

  - ### setStrokeWidth

    public Polyline setStrokeWidth(int strokeWidth)
    Sets the stroke width in pixels.

  - ### getStrokeAlpha

    public int getStrokeAlpha()
    The stroke opacity in [0,255].

  - ### setStrokeAlpha

    public Polyline setStrokeAlpha(int strokeAlpha)
    Sets the stroke opacity in [0,255].

  - ### isVisible

    public boolean isVisible()
    Whether the polyline is rendered.

  - ### setVisible

    public Polyline setVisible(boolean visible)
    Shows or hides the polyline.