Echarts地图坐标geoCoordMap数据获取

 数据来源网站 :http://datav.aliyun.com/tools/atlas/#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 

    public Map getProvinceGeo() {
        String body = HttpUtil.get("https://geo.datav.aliyun.com/areas_v2/bound/100000_full.json");
        JSONArray features = JSONUtil.parse(body).getByPath("features", JSONArray.class);
        Map map = new HashMap<>(8);
        features.forEach(v -> {
            JSONObject json = JSONUtil.parseObj(v);
            String name = json.getByPath("properties.name", String.class);
            Object center = json.getByPath("properties.center", Object.class);
            map.put(StrUtil.removeAny(name, "省"), center);
        });
        return map;
    }

 

你可能感兴趣的:(Java)