Skip to main content

Polylines

To add one or more polylines, use the polyline parameter one or multiple times in the URL query in the following format:

polyline=polylineStyle|polylineCoord1|polylineCoord2|...
  • polylineCoord:

    • Lat, Lon Coordinates: Coordinates in lat, lon format, separated by |. You need at least two coordinates.
    • Encoded Polylines: You can also use Google Encoded Polyline format.
  • polylineStyle: Customize the polyline with:

    ParameterDefaultDescription
    weight6Sets the stroke width of the polyline.
    color#0000ffDefines the stroke color of the polyline.
    fillSpecifies the fill color of the polyline.
    strokeDasharray(none)Pattern of dashes and gaps, e.g., 5,5 see stroke-dasharray.
    withGeodesicLinetrueWhen true, generates geodesic lines between each pair of coordinates. Set to false to draw straight lines.

Note: By default, for each pair of coordinates in the input, a geodesic line is generated between them. You can disable this behavior by setting withGeodesicLine:false.

Regular Coordinates example with no zoom, weight:6, color:0000ff

Regular Coordinates Example

Multiple Encoded Polylines

Multiple Encoded Polylines Example