How do I create a pair of longitude and latitudes to show a 2 mile radius of a particular longitude and latitude? in Java Android

StackOverflow https://stackoverflow.com/questions/21973500

Вопрос

Out of my depth a little :-) How do I create a pair of longitude and latitudes to create a polygon showing a 2 mile radius of a particular longitude and latitude? in Java Android. I know how to find your current longitude and latitude but I just can't figure out the above.

My code so far is below:

LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); 
Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
double longitude = location.getLongitude();
double latitude = location.getLatitude();

Нет правильного решения

Другие советы

You can create the pair using LatLng.

        LatLng origin = new LatLng(my_latitude,my_longitude);

For creating a radius you can use Genofencing technique.

https://developer.android.com/training/location/geofencing.html

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top