How to get the estimated time arrival between 2 points
Some factors you would need to consider:
- method of travel (walking, cycling, driving, flying) & type of vehicle (e.g. a bus would be slower than a Ferrari)
- route taken
- speed that can be travelled at for each part of the route (speed limits)
- traffic, roadworks
- time of day
- weather
You would also need to "navigate" the route...
Welcome Cindy.
Several ways after considering Tim's advice:
-
- Using Navigate component HOW TO: Use the Navigate control
GotDirections(directions,points,distance,duration)
Event indicating that a request has finished and has returned data. The following parameters are provided:
directions
: A list of text directions, such as “Turn left at Massachusetts Avenue”.points
: A list of (latitude, longitude) points that represent the path to take. This can be passed toLineString
’sPoints
to draw the line on aMap
.distance
: Estimated distance for the route, in meters.duration
: Estimated duration for the route, in seconds.
-
- Google Map Directions api https://developers.google.com/maps/documentation/directions or Google Distance Matrix api Get started with the Distance Matrix API | Google for Developers
-
- calculate it (the estimated time of arrival if you know the distance and average speed).
To find the time taken by driving
assuming:
Distance covered by your route = 120km
Average peed of a car = 60 km/hr
Using Formula of Time,
Time = Distance/Speed
= 120/60
= *2 hr
Time left a point: 3 pm
3pm + 2 hr = 5pm estimated arrival time
1 Like