Regarding WebSocket API, specifically Devices list loading one by one.

samaidha17 days ago

Hi, Good Morning.
I am receiving data over WebSocket as:

{
  "devices": [...],
  "positions: [...],
  "events": [...]
}

Which I am using to display them on my custom front-end.

After the initial socket connection, I get the list of all the 'positions' (of all the vehicles instantly and renders the markers on a map), However the 'devices' list (which include the names of the 30 vehicle), info loads one by one, and it takes some time to render all the names in the front-end.

My question is, is there a way I can load the device list instantly as the position list? or am I missing something?

I am asking this because, in the Traccar's default web interface ( I'm guessing which is using WebSocket) renders the markers with names on the page instantly.

Thank you.

Anton Tananaev17 days ago

You should just call /api/devices to get the list.

samaidha17 days ago

Thanks.