Get the distance between two geo points

后端 未结 9 606
旧巷少年郎
旧巷少年郎 2020-11-27 09:11

I want to make an app which checks the nearest place where a user is. I can easily get the location of the user and I have already a list of places with latitude and longitu

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 09:51

    There are two ways to get distance between LatLng.

    public static void distanceBetween (double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results)
    

    See this

    and second

    public float distanceTo (Location dest) as answered by praveen.

提交回复
热议问题