有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (2) 个答案

  1. # 1 楼答案

    我使用firebase db和geoFire来解决这个问题。如果你能从数据库中获取每个点,你可以检查“距离”,比如:

    double distance = SphericalUtil.computeDistanceBetween(pointCoordinate, myCoordinate);
    

    import com.google.maps.android.SphericalUtil;。 但是,如果你有一个大的数据库,有很多点,这可能是一个问题

  2. # 2 楼答案

     double distanceInMiles = Utils.calculateDistanceBetweenGeoPoints(
                                        currentLocation.getLatitude(),
                                        currentLocation.getLongitude(),
                                        otherLatitude,
                                        otherLongitude);