Tracking a vehicle

Hello developers.

TomTom is cool!
So far I have been using a combination of Browser Geolocation API, HTML and AJAX, to send the positions of a moving vehicle to our database, every 30 seconds.
A different page on the server, retrieves the desired GPS data for each vehicle and plots these points using the Maps Javascript API. When somebody is “tracking” the position of a vehicle in real-time the script that prepares the Maps TomTom Javascript creates an HTML page which shows the map. In the <head> of the resulting HTML does a “window.location = window.location.href;” every 30 seconds to show the latest position/path of the vehicle.

Of course, this causes a refresh of the whole page which is not data or CPU efficient on the client side or the server, as the whole Map and the vehicles’ trip is redrawn.

Is there a TomTom recommended methodology for simply adding the latest GPS position marker to a web map ? Perhaps an AJAX call to the server could simply pull the latest GPS positions and add them to the map being displayed on the browser already.

I hope I’ve made my question clear enough for you to answer.


bonjour il yas bien ce script si ca peut t’aider c’est dans les projet tomtom

bonjour. Merci but… :grimacing:

:heart_eyes: :heart_eyes: