I am now using Google mapV2 in my application. i am unable to find distance between 2 locations(Geo-points) and can i calculate the duration to reach from source to destination(by walk or drive)..is there any Google API available?if not so,please guide me to a good tutorial?
Asked
Active
Viewed 452 times
-1
-
Possible Duplicate of: http://stackoverflow.com/questions/14394366/find-distance-between-two-points-on-map-using-google-map-api-v2 – progrrammer Jun 21 '13 at 08:51
-
google map v2 working fine ?if yes then plz share your source code. – Hemantvc Jun 21 '13 at 09:03
1 Answers
1
It is possible to work out the distance by using Locations
and the Distance To
methods.
E.g
Location locationA = new Location("Point A");
locationA.setLatitude(POINT A LATITUDE);
locationA.setLongitude(POINT A LONGITUDE);
Location locationB = new Location("Point B");
locationB.setLatitude(POINT B LATITUDE);
locationB.setLongitude(POINT B LONGITUDE);
double distance = locationA.distanceTo(locationB);

SquiresSquire
- 2,404
- 4
- 23
- 39