You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/11/05 02:26:00 UTC

[GitHub] DorisOu commented on issue #4017: 自定义geojson的多边形,部分简单多边形渲染不出来

DorisOu commented on issue #4017: 自定义geojson的多边形,部分简单多边形渲染不出来
URL: https://github.com/apache/incubator-echarts/issues/4017#issuecomment-435736521
 
 
   你好,我最近在做一个项目,需要在百度地图上画自定义的区域,但是我发现实现不了。只能画单一的一个。
   var var paths = [
           [
               [113.447976, 22.363792],
               [113.328872, 22.422652],
               [113.370276, 22.308298],
               [113.474307, 22.260588]
   
           ],
           [
               [113.55542316292018, 22.451920414231754],
               [113.55552840279444, 22.452818734758235],
               [113.55371761986818, 22.453423869526087],
               [113.55356109301499, 22.454512840320145]
           ]
       ]
   function renderItem(params, api) {
           var coords = paths[0];
           var points = [];
           for (var i = 0; i < coords.length; i++) {
               points.push(api.coord(coords[i]));
           }
           return {
               type: 'polygon',
               shape: {
                   points: echarts.graphic.clipPointsByRect(points, {
                       x: params.coordSys.x,
                       y: params.coordSys.y,
                       width: params.coordSys.width,
                       height: params.coordSys.height
                   })
               },
               style: api.style({
                   fill: 'lightblue',
                   stroke: '#000'
               })
           }
       }
   
   要怎么实现循环渲染?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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