hsilence opened a new issue #9007: 移动端地图组件省份区域添加点击事件有时无效,要双击才可以
URL: https://github.com/apache/incubator-echarts/issues/9007
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   移动端地图组件省份区域添加点击事件有时无效,要双击才可以
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:  echarts4
   + Browser version [浏览器类型和版本]: 手机自带的浏览器和微信里的内嵌浏览器
   + OS Version [操作系统类型和版本]: android
   
   
   
   
   
   ### Expected behaviour [期望结果]
   单击事件生效,不用双击。
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   let convertData = function (data, geoCoordMap) {
       var res = [];
       for (var i = 0; i < data.length; i++) {
           var geoCoord = geoCoordMap[data[i].name];
           if (geoCoord) {
               res.push({
                   name: data[i].name,
                   value: geoCoord.concat(data[i].state)
               });
           }
       }
       return res;
   };
   option = {
   tooltip: {
                   trigger: 'item',
                   show: false,  
                   borderWidth: 2, 
                   borderColor: '#19A3C6',
                   textStyle:{
                       fontSize: 18, 
                   },
               },
               visualMap: {
                   min: 0,
                   max: 1,
                   splitNumber: 5,
                   inRange: {
                       color: ['#44AA66','#44AA66'],
                   },
                   textStyle: {
                       color: '#fff'
                   },
                   show: false
               },
               geo: {
                   map: 'china',
                   label: {
                       emphasis: {
                           show: false
                       }
                   },
                   zoom: 1.2,
                   // roam: true,
                   itemStyle: {
                       normal: {
                           areaColor: '#060608',
                           borderWidth: 1, 
                           borderColor: '#02121e', 
                           shadowColor: 'rgba(0, 0, 0, 0.5)',
                           shadowBlur: 15,
                       },
                       emphasis: {
                           areaColor: '#0d0f12',
                           borderColor: '#337c4c'
                       },
                   },
                   regions: [{
                       name: prevince,
                       selected: true,
                       itemStyle: {
                                                areaColor: '#0d0f12',
                           borderColor: '#337c4c',
                           borderWidth: 1,
                        }
                   }],
               },
               series: [
                   {
                       type: 'scatter',
                       coordinateSystem: 'geo',
                       data: convertData(dataOnline, geoCoordMap),
                       symbolSize: pointSize,
                       itemStyle: {
                           normal: {
                               color: '#44AA66'
                           }
                       },
                       label: {
                           normal: {
                               show: false
                           },
                           emphasis: {
                               show: false
                           }
                       },
                   },
                   {
                       type: 'scatter',
                       coordinateSystem: 'geo',
                       data: convertData(dataOffline, geoCoordMap),
                       symbolSize: pointSize,
                       itemStyle: {
                           normal: {
                               color: '#FF5E3A'
                           }
                       },
                       label: {
                           normal: {
                               show: false
                           },
                           emphasis: {
                               show: false
                           }
                       },
                       zlevel: 1,
                   }
               ]
   }
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
![_20180904171943](https://user-images.githubusercontent.com/20702713/45022401-bedb5c80-b066-11e8-9836-2fcc0046f15a.jpg)
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@echarts.apache.org
For additional commands, e-mail: dev-h...@echarts.apache.org

Reply via email to