let mapEvent = null //地图实例
let cityName = '济南'
let tableData = [
{cityName:"济南",value:10},
{cityName:"青岛",value:10},
]
// 获取地市下标
const cityDataIndex = tableData.value.findIndex(
item => item.cityName === cityName
);
// 获取地图的 geo 组件
const geoComponent = mapEvent.value.getModel().getComponent('geo', 1);
// 获取城市在地图上的像素坐标
const pixelCoord = geoComponent.coordinateSystem.dataToPoint(cityName);
const clickParams = {
name: cityName,
dataIndex: cityDataIndex,
event: {
offsetX: pixelCoord[0],
offsetY: pixelCoord[1],
},
};
根据城市名称获取Echarts地图区域的页面xy信息
最新推荐文章于 2025-12-10 11:05:52 发布
1247

被折叠的 条评论
为什么被折叠?



