| | |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.utils.HttpUtils; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | /** |
| | | * 高德地图的地理编码工具类 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @Lazy |
| | | public class GDMapGeocodingUtil { |
| | |
| | | if(routePlanRule!=null){ |
| | | params.put("strategy", routePlanRule); |
| | | } |
| | | |
| | | log.info("高德地图接口:{}", url); |
| | | log.info("高德地图参数:{}", params); |
| | | String post = HttpUtils.post(url, JSON.toJSONString(params)); |
| | | System.out.println("高德地图返回结果:"+ post); |
| | | // String forObject = restTemplate.getForObject(url, String.class, params); |
| | | log.info("高德地图返回结果:"+ post); |
| | | JSONObject jsonObject = JSON.parseObject(post); |
| | | String data = jsonObject.getString("data"); |
| | | |
| | |
| | | params.put("sdkVersion", "9.850.152.3.532"); |
| | | params.put("encoderVersion", "5.1"); |
| | | String post = HttpUtils.post(url, JSON.toJSONString(params)); |
| | | System.out.println("高德地图返回结果:"+ post); |
| | | log.info("高德地图返回结果:"+ post); |
| | | return post; |
| | | } |
| | | |