addPolyline

Adds a polyline to the sphere using specified latitude and longitude points for vertices. See the main polyline page for a definition of what a polyline is.

Parameter

  • A single un-named object with the following attributes. Several are optional:

    • id (number | string, optional): Unique id for the polyline. If not provided, this is auto-generated by the viewer.

    • name (string, optional): Name for the polyline. Similar to id but does not have to be unique. To be used in later features.

    • points (Array<{lat: number, lng: number}>): The list of polyline vertices used to render the polyline in the viewer.

    • color (string, optional): The color to paint the polyline when rendered. Accepts standard html color names (like blue) or hex values. Default: red

    • opacity(number, optional): The opaque level value to use. 100 is fully opaque, 0 being invisible.

    • layer(string, optional): When passed, the polygon will be added to the named layer. Default: "default"

    • width (number, optional): Sets the width of the line being drawn. Each increment is approximately 1 pixel. For example, a width of 3 is approximately 3 pixels wide. Default: 1

Code Sample