krabouilleur opened a new issue, #18042:
URL: https://github.com/apache/echarts/issues/18042

   ### What problem does this feature solve?
   
   If I click on a "line" created by "coords" in a serie of type "lines", I 
can't know what "coords" index is clicked :
   
   for example : 
   
   ```
   var mousePosition = null;
   
   $.get(
     ROOT_PATH + '/data/asset/geo/MacOdrum-LV5-floorplan-web.svg',
     function (svg) {
       echarts.registerMap('MacOdrum-LV5-floorplan-web', { svg: svg });
       option = {
         tooltip: {
           triggerOn: 'none'
         },
         geo: {
           map: 'MacOdrum-LV5-floorplan-web',
           roam: true
         },
         series: [
           {
             name: 'Route',
             type: 'lines',
             coordinateSystem: 'geo',
             geoIndex: 0,
             polyline: true,
             lineStyle: {
               color: '#c46e54',
               width: 5,
               opacity: 1,
               type: 'dotted'
             },
             tooltip: {
               trigger: 'item',
               position: function (pos, params, dom, rect, size) {
                 return mousePosition;
               },
               formatter: function (params) {
                 return params.seriesName;
               }
             },
             data: [
               {
                 coords: [
                   [61.58708083147317, 386.87942320312504],
                   [61.58708083147317, 72.8954315876116],
                   [258.29514854771196, 72.8954315876116]
                 ]
               }
             ]
           }
         ]
       };
       myChart.setOption(option);
     }
   );
   
   myChart.on('mouseover', 'series.lines', function (params) {
     console.log('MOUSE', params)
     mousePosition = [params.event.offsetX, params.event.offsetY];
   
     myChart.dispatchAction({
       type: 'showTip',
       seriesIndex: params.seriesIndex,
       dataIndex: params.dataIndex
     });
   });
   
   myChart.on('click', 'series.lines', function(params) {
     console.log('I DON\'T KNOW WHICH "coords" index is clicked')
   });
   
   ```
   
   ### What does the proposed API look like?
   
   what it would be best:
   
   1. if I click on the line (or mouseover) generated by coords on a type 
"line**s**" series,
   2. the "params" response should have a property "coords" which give the 2 
coords between the line 
   3. eg. coords: 
   `coords:  [  [61.58708083147317, 386.87942320312504],   [61.58708083147317, 
72.8954315876116]   ]`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to