http://datav.aliyun.com/portal/school/atlas/area_selector#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5
获取的地图json制作json示例地图json
{
"type": "Feature",
"properties": {
"adcode": 130702,
"name": "桥东区",
"center": [
114.885658,
40.813875
],
"centroid": [
115.049193,
40.758806
],
"childrenNum": 0,
"level": "district",
"parent": {
"adcode": 130700
},
"subFeatureIndex": 0,
"acroutes": [
100000,
130000,
130700
]
},
this.$echarts.registerMap("张家口", res)
let arr = [];
for (let i = 0; i < res.features.length; i++) {
let obj = {
name: res.features[i].properties.name,
areaName: res.features[i].properties.areaName,
areaCode: res.features[i].id,
areaLevel: "districts",
value: Math.round(Math.random()),
};
arr.push(obj);
}
下面代码是添加图片,x,y内的值都是我从地图json里面拿出来的,但是每个经纬度都显示在一个位置上,根本不起作用
series = [
{
type: 'custom',
coordinateSystem: 'geo',
renderItem: function (params, api) {//具体实现自定义图标的方法
let img = require('@/assets/screen/bbb.png');
return {
type: 'image',
style: {
image: img,
x: api.coord([115.049193, 40.813875])[0],
y: api.coord([115.049193, 40.813875])[1],
}
}
},
//自定义图片的 位置(lng, lat)
data,
zlevel: 3
},
{
name: map,
zoom: 1.22,
mapType: map,
...mapOption4.seriesOption,
}
经纬度 问题 吧