You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/03/30 10:54:22 UTC

[GitHub] [echarts] stanzah opened a new issue #14559: custom polygon can't find in coordinateSystem geo map

stanzah opened a new issue #14559:
URL: https://github.com/apache/echarts/issues/14559


   ### Version
   5.0.0
   
   ### Steps to reproduce
   ```html
   <body>
     <div id="test" style="width: 748px; height: 621px"></div>
   </body>
   
   <script
     type="text/javascript"
     src="http://api.map.baidu.com/api?v=2.0&ak=ak"
   ></script>
   <script src="./echarts.min.js"></script>
   <script src="./bmap.js"></script>
   ```
   
   ```javascript
   $.get(
     'https://geo.datav.aliyun.com/areas_v2/bound/530000_full.json',
     function (geoJson) {
       echarts.registerMap('云南', geoJson)
       var chart = echarts.init(document.getElementById('test'))
       var option
   
       function renderItem(params, api) {
         var coords = [
           [102.61552888, 25.28846059],
           [102.60288074, 25.08442824],
           [102.88056495, 25.07081382],
           [102.87654055, 25.28427879],
         ]
         var points = []
         for (var i = 0; i < coords.length; i  ) {
           points.push(api.coord(coords[i]))
         }
         var color = api.visual('color')
   
         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: color,
             stroke: echarts.color.lift(color),
           }),
         }
       }
   
       option = {
         bmap: {
           center: [102.87654055, 25.28427879],
           zoom: 10,
         },
         geo: {
           show: true,
           map: '云南',
           aspectScale: 1,
           scaleLimit: { min: 1.1, max: 20 },
           itemStyle: {
             normal: {
               areaColor: 'rgba(0,144,144,1)',
               borderColor: 'rgba(1,222,222,.5)',
               borderWidth: 1.5,
               shadowColor: '#00ffff',
               shadowOffsetX: 0,
               shadowOffsetY: 0,
               shadowBlur: 1,
             },
             emphasis: {
               areaColor: 'rgba(0,104,104,1)',
             },
           },
           label: {
             show: true,
             color: '#fff',
             emphasis: {
               color: '#fff',
             },
           },
           zoom: 1.2,
           left: 'center',
           roam: 'scale',
         },
         series: [
           {
             type: 'custom',
             coordinateSystem: 'geo',
             renderItem: renderItem,
             itemStyle: {
               opacity: 0.5,
             },
             data: [0],
             z: 10,
           },
         ],
       }
   
       option && chart.setOption(option)
     }
   )
   ```
   
   ### What is expected?
   custom polygon 可以在 geo 里渲染出来。
   
   ### What is actually happening?
   如上代码块所设置,直接设置 `coordinateSystem: 'geo'`,无法找到 polygon。如果设置`coordinateSystem: 'bmap'`,可以在百度地图里找到 polygon。
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
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.

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



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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14559: custom polygon can't find in coordinateSystem geo map

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14559:
URL: https://github.com/apache/echarts/issues/14559#issuecomment-810124068


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


-- 
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.

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



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