获取点击事件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 (将#修改为@)