Example:
//Get the current location
Location startingLocation = new Location("starting point");
startingLocation.setLatitude(myMap.getCameraPosition().target.latitude);
startingLocation.setLongitude(myMap.getCameraPosition().target.longitude);
//Get the target location
Location endingLocation = new Location("ending point");
endingLocation.setLatitude(<target>.latitude);
endingLocation.setLongitude(<target>.longitude);
//Find the Bearing from current location to next location
float targetBearing = startingLocation.bearingTo(endingLocation);
Title: Get bearing between two location using android.location.Location
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 8:58 AM
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 8:58 AM
0 comments:
Post a Comment