Google Maps Tracks - tracking route taken -


we developing app client, 1 function of following:

user selects "start journey" , @ predefined intervals gets current location (probably lat/long) gps. user selects "end journey"

at end of journey, know distance travelled. @ no point display of map necessary, journey distance. may not know route in advance. also, part of journey may on public transport, rail etc. possible prompt user "mode of transport change" en-route.

it seems me google maps tracks could appropriate tool, cannot seem see how this.

we have need predefined routes. again, no map strictly needed, happy set of routes in text from maps directions api, terms of service seem strictly prohibit directions in map-less form.

the distance travelled may calculated server-side if app presents set of journey waypoints submission our internal api, , in case google api's accessed php.

any bright ideas ? (apologies if duplicate of other query, i'm damned if can find anything!)

the question might duplicate google maps saving draggable directions, depends on how people see it.

basically, add event directionsrenderer when it's changed.

google.maps.event.addlistener({{directionsrenderer}},'directions_changed', function() {   var waypoints = directionsrenderer.directions.route[0].legs[0].via_waypoint; }); 

when user confirm route, save origin, destination, travel mode, , waypoints, , check existing ones.

https://developers.google.com/maps/documentation/javascript/directions

you can get polyline directions, use if want.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -