echarts geo地图坐标转换为页面Offset坐标

时间:2024-07-28 19:35:14

https://github.com/apache/incubator-echarts/issues/2540

代码示例:

// 获取系列
var seriesModel = myChart.getModel().getSeriesByIndex(opts.series.length - )
// 获取地理坐标系实例
var coordSys = seriesModel.coordinateSystem;
// dataToPoint 相当于 getPosByGeo
var point = coordSys.dataToPoint([current.lng, current.lat]);
// 直接显示layer
showkeySupervision__layer(point[], point[], current)