How to draw polylines?

After fetching traffic data from the Traffic API, I got a JSON file including flow speed and an array of coordinates. So how can I display these coordinates as polylines on my basic map? I look around the Web SDK documentation but didn’t find a method to achieve this.

So you don’t want to use Traffic Flow layer and just draw a single polyline?
Actually you can convert it to a GeoJSON LineString and add it as a layer.

example of a LineString:

    "type": "LineString", 
    "coordinates": [
        [30.0, 10.0],
        [10.0, 30.0],
        [40.0, 40.0]

And here are examples: Map examples | Maps SDK Web JS v6
where you can find several with adding GeoJSON