| | |
| | | } |
| | | |
| | | // 计算距离 |
| | | String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); |
| | | String userLocation = String.format("%s,%s", longitude, latitude); |
| | | Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); |
| | | Double wGs84 = distanceMap.get("WGs84"); |
| | | shopDetailVO.setDistance(wGs84); |
| | | if (shopDetailVO.getLongitude() != null && shopDetailVO.getLatitude() != null){ |
| | | String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); |
| | | String userLocation = String.format("%s,%s", longitude, latitude); |
| | | Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); |
| | | Double wGs84 = distanceMap.get("WGs84"); |
| | | shopDetailVO.setDistance(wGs84); |
| | | } |
| | | return shopDetailVO; |
| | | } |
| | | |