I need to find the estimate drive time from one place to another. I've got latitudes and longitudes for both places but I have no idea how to do that. Is there is any API for that. help thanks.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
yes you get the time and distance value as well as many like direction details in driving, walking etc mode. all you got from the google direction api service
check our this links
http://code.google.com/apis/maps/documentation/directions/
EDIT :
Please also see this, if above not works for you:
Calculate distance between two points in google maps V3
As already described by Praktik, you can use Google's directions API to estimate the time needed to get from one place to another taking directions and traffic into account. But you don't have to use the web API and build your own wrapper, instead use the Java implementation provided by Google itself, which is available through the Maven/gradle repository.
Add the google-maps-services to your app's build.gradle:
Perform the request and extract the duration:
For simplicity, this code does not handle exceptions, error cases (e.g. no route found -> routes.length == 0), nor does it bother with more than one route or leg. Origin and destination could also be set directly as
LatLng
instances (seeDirectionsApiRequest#origin(LatLng)
andDirectionsApiRequest#destination(LatLng)
.Further reading: android.jlelse.eu - Google Maps Directions API
You can also use http://maps.google.com/maps?saddr={start_address}&daddr={destination_address}
it will give in direction detail along with distance and time in between two locations
http://maps.google.com/maps?saddr=79.7189,72.3414&daddr=66.45,74.6333&ie=UTF8&0&om=0&output=kml