如何解决获取点击事件echarts的地理坐标
我使用的是echarts,这是很棒的lib,在点击地图后,我无法在点击事件数据中找到地理坐标(纬度,经度)。这是我的地图:
this.options = {
title: {
text: this.placeName,left: 'center',top: '16px',textStyle: {
color: this.bubbleTheme.areaHoverColor,},tooltip: {
trigger: 'item',formatter: params => {
return `Id : ${params.value[2]}`;
},geo: {
name: this.placeName,type: 'map',map: 'world',roam: false,label: {
emphasis: {
show: false,itemStyle: {
normal: {
areaColor: this.bubbleTheme.areaHoverColor,borderColor: this.bubbleTheme.areaHoverColor,emphasis: {
areaColor: this.bubbleTheme.areaHoverColor,zoom: 1,series: [
{
type: 'scatter',coordinateSystem: 'geo',data: this.mapData.map(marker => {
return {
name: marker.id,value: [
marker.longitude,marker.latitude,marker.id,],};
}),};
});
我正在通过角度指令ngx-echarts使用echarts,正在使用geojson数据(动态地从shapefile创建)创建地图。我已经绑定了指令的onChartClick事件:
<div echarts
*ngIf="goLoadMap"
[options]="options"
(chartInit)="onChartInit($event)"
(chartClick)="onChartClick($event)"
class="echarts"></div>
任何帮助或提示将不胜感激。谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。