| | |
| | | * @return |
| | | */ |
| | | public Map<String, String> getDistance(String origins, String destination, Integer type){ |
| | | |
| | | String[] split = origins.split(","); |
| | | String[] split1 = destination.split(","); |
| | | origins = split[1] + "," + split[0]; |
| | | destination = split1[1] + "," + split1[0]; |
| | | |
| | | String url = "https://api.map.baidu.com/directionlite/v1/driving?origin="+origins+"&destination="+destination+"&ak="+key; |
| | | String forObject = restTemplate.getForObject(url, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(forObject); |