You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building Directions with multiple alternative routes, and I wanna start the route using current location of the user to track the progress, is this a way to do this? does google allow? For example we can set the origin based on real time GPS data , so we can keep track of the progress
as for the terms of service: As far as I know, only use-cases involving turn-by-turn navigation are prohibited by the ToS, and I think there were some special regulations for fleet-management applications. Other than that, just showing a route on a map should be fine. Definitely check with an expert on possible licensing issues before investing a lot into developing the software.
retrieving and rendering the routes can be done using the DirectionsService and DirectionsRenderer, or you can build your own renderer using polylines for example if you have anything special in mind. You can use anything as a starting-point, including the coordinates received from GPS.
tracking progress is difficult, generally you'll want to have an algorithm to match the current GPS location against the recommended route to figure out which leg of the route the user is on, and you probably also have some heuristic to detect when the user is no longer on the route. (Depends on the mode of transport, but heading, speed and distance from the recommended route would be factors here.) You could also re-create the route when the user moves too far away from the route for whatever reason, but keep in mind that this could get expensive and you definitely want to rate-limit this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am building Directions with multiple alternative routes, and I wanna start the route using current location of the user to track the progress, is this a way to do this? does google allow? For example we can set the origin based on real time GPS data , so we can keep track of the progress
Beta Was this translation helpful? Give feedback.
All reactions