How to draw the same trajectory at the same time by JavaScript

In the

scenario, I have used a map plug-in, which will request a data source, that is, track data. Now there are several estimates to be displayed, that is, you need to create several different classes for adjusting maps, and then request different track data and draw them in real time at the same time. Could you tell me how to implement it with javascript? Do I need to use async?

Mar.22,2021

it is not enough for two items to be drawn asynchronously at the same time. Js is single-threaded, even if it is asynchronous, it is also event polling, and it is also executed one by one. In your case, you can only open another thread. The, new Worker class may help you achieve it. I will not repeat the use of the Worker class.

compatibility is as follows:
clipboard.png

and find out if the plug-in you use has the function of drawing multiple lines. I remember that there was a map framework called leaflet. There was a plug-in that supports drawing multiple lines at the same time. In fact, a single thread can draw multiple lines at the same time, that is, to see if others have written it or not. It is nothing more than switching elements in two arrays to draw. If the execution speed is fast enough, people will feel that they are drawn at the same time

.
Menu