I'm really newbie in JS, so sorry, that I have no my code attached, 'cause all what I did - "helloworld" examples from Google Map Docs.
So, what's a problem: I want to draw a polyline depending on user's current position. So, each one google.maps.LatLng() should have coordinates at the moment. On the map should emerge the whole way updating, for example, once per 5 seconds. At last point it's just like visualization of a morning walking on a map, something like that.
I know, how to "draw" a map and add points in var flightPlanCoordinates[], and I ask for some examples or links, where I can find:
- How add a current position into var flightPlanCoordinates[]
- How make all this stuff updating in "live" mode
Thanks for any help :)
UPD:
trying to do stuff like this, but doesn't work
var path = poly.getPath();
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
path.push(new google.maps.LatLng(latitude, longitude));
UPD2: here's cool example, how it should be http://kasheftin.github.io/gmaps/