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 2022/12/17 02:43:30 UTC
[GitHub] [echarts] minren118 opened a new issue, #18073: [Bug] map系列中,数据标签如果经度是负数时显示错位
minren118 opened a new issue, #18073:
URL: https://github.com/apache/echarts/issues/18073
### Version
5.4
### Link to Minimal Reproduction
_No response_
### Steps to Reproduce
我使用自己制作的一个地图数据,里面有cp节点,正常来说,它会调用这个cp节点来自定义渲染数据标签位置,但现在使用世界地图时,因其经纬度跨越-180到180和-90到90,在0-180的经度显示正常,-180-0时,就不正常,如美国是-100的经度,数据标签显示到了中国位置,同样地纬度显示也不正常如澳大利亚。
这个疸仅在数据标签上异常,在散点地图上是可以正常的。



### Current Behavior
出现了数据标签显示错位问题。
### Expected Behavior
期待修复下这个取cp值作为填色地图时,显示数据标签位置错误的问题。
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
_No response_
--
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-unsubscribe@echarts.apache.org.apache.org
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 #18073: [Bug] map系列中,数据标签如果经度是负数时显示错位
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #18073:
URL: https://github.com/apache/echarts/issues/18073#issuecomment-1355975840
@minren118 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
<details><summary><b>TRANSLATED</b></summary><br>
**TITLE**
[Bug] In the map series, data labels are displayed out of place if the longitude is negative
**BODY**
### Version
5.4
### Link to Minimal Reproduction
_No response_
### Steps to Reproduce
I use a map data made by myself, which contains a cp node. Normally, it will call this cp node to customize the position of the rendered data label, but now when using the world map, because its latitude and longitude spans -180 to 180 and -90 to 90, the longitude of 0-180 is displayed normally, and when it is -180-0, it is abnormal. For example, the longitude of -100 in the United States, the data label shows the location of China, and the latitude display is also abnormal, such as Australia.
This jaundice is only abnormal on the data label, but it is normal on the scatter map.



### Current Behavior
There is a problem with the display of data labels being misplaced.
### Expected Behavior
Looking forward to fixing the problem that when the cp value is used as a coloring map, the wrong position of the data label is displayed.
### Environment
```markdown
- OS:
-Browser:
- Framework:
```
### Any additional comments?
_No response_
</details>
--
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-unsubscribe@echarts.apache.org
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] plainheart commented on issue #18073: [Bug] map系列中,数据标签如果经纬度是负数时显示错位
Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #18073:
URL: https://github.com/apache/echarts/issues/18073#issuecomment-1356965519
这好像是你转换的问题,根据截图圈出部分的正则表达式来看,只能匹配到数字部分,而无法匹配正负符号,例如,`-120.1` 会被转换为 `120.1`,这应该是是 label 位置不对的原因。
这里转换其实不必那么麻烦,按照如下方式转换即可:
```js
features[index].properties.cp = cpStr.split(',').map(t => +t)
// 或者
features[index].properties.cp = cpStr.split(',').map(Number)
```
--
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-unsubscribe@echarts.apache.org
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] minren118 commented on issue #18073: [Bug] map系列中,数据标签如果经纬度是负数时显示错位
Posted by GitBox <gi...@apache.org>.
minren118 commented on issue #18073:
URL: https://github.com/apache/echarts/issues/18073#issuecomment-1356735619
补充下,并不是我的goejson有问题,我自己维护的cp值虽然是文本,但最终会在代码里转成数组结构的,在中国地图这种没有跨正负经纬度的地图数据标签显示是没问题的。

--
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-unsubscribe@echarts.apache.org
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] plainheart closed issue #18073: [Bug] map系列中,数据标签如果经纬度是负数时显示错位
Posted by GitBox <gi...@apache.org>.
plainheart closed issue #18073: [Bug] map系列中,数据标签如果经纬度是负数时显示错位
URL: https://github.com/apache/echarts/issues/18073
--
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-unsubscribe@echarts.apache.org
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] minren118 commented on issue #18073: [Bug] map系列中,数据标签如果经纬度是负数时显示错位
Posted by GitBox <gi...@apache.org>.
minren118 commented on issue #18073:
URL: https://github.com/apache/echarts/issues/18073#issuecomment-1357114761
献丑了,还真是自己正则没写好,之前一直搞中国地图,没看到有负数的情况,正则不兼容,感谢指导,写js不深,原来还可以这么个方式写,学习了。
--
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-unsubscribe@echarts.apache.org
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