Have you had a look at the Google Maps API?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
How are you receiving the vehicle's data? Which format?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Can't you add and remove points via the API? However, I don't think it will change in real time, otherwise you'd have to Ajax the DB/ Map container every 30s or so.
My take:
If you can store the data automatically.
On page load, get the latest DB lat/long and then load the map with only the latest point and the route.
Is that what you want/need. Can you do it?
If you're using V.3:
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var myOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title:"Hello World!"
});
from the API documentation.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080