0

Multiple vessel tracking (Leaflet.js)

I have established a connection to an API via websockets. The server sends back a new array with objects in JSON form with various data on ships (id, lat, lon, speed, course, etc). How can I make each ship’s coordinates correspond to a marker and depict multiple markers on the map? I am using vanilla JavaScript.

11th Jan 2021, 1:28 PM
El Pep
El Pep - avatar
2 Réponses
+ 3
I have a map with marker for you https://code.sololearn.com/W3shDbSYhU9e/?ref=app
11th Jan 2021, 1:44 PM
Calviղ
Calviղ - avatar
+ 1
Thanks for your answer Calvin! I can already add a single marker though. The problem arises because there are multiple markers required and I can’t get the loop right.
11th Jan 2021, 5:08 PM
El Pep
El Pep - avatar