-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] 地图使用 geoIndex 后 labelLayout 失效 #20600
Comments
@linwrui 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. 🤗 TRANSLATEDTITLE [Bug] labelLayout does not work after using geoIndex for the map BODY Version5.5.1 Link to Minimal Reproductionhttps://echarts.apache.org/examples/zh/editor.html?c=map-HK Steps to Reproduce
myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/geo/HK.json', function (geoJson) {
myChart.hideLoading();
echarts.registerMap('HK', geoJson);
myChart.setOption(
(option = {
title: {
text: 'Population Density of Hong Kong (2011)',
subtext: 'Data from Wikipedia',
sublink:
'http://zh.wikipedia.org/wiki/%E9%A6%99%E6%B8%AF%E8%A1%8C%E6%94%BF%E5%8D%80%E5%8A%83# cite_note-12'
},
tooltip: {
trigger: 'item',
formatter: '{b}<br/>{c} (p / km2)'
},
toolbox: {
show: true,
orientation: 'vertical',
left: 'right',
top: 'center',
feature: {
dataView: { readOnly: false },
restore: {},
saveAsImage: {}
}
},
visualMap: {
min: 800,
max: 50000,
text: ['High', 'Low'],
realtime: false,
calculable: true,
inRange: {
color: ['lightskyblue', 'yellow', 'orangered']
}
},
geo: {
map: 'HK',
show: true,
roam: true,
label: { show: true },
labelLayout: {
hideOverlap: true
}
},
series: [
{
name: 'Population density of Hong Kong 18 districts',
type: 'map',
map: 'HK',
geoIndex: 0,
coordinateSystem:'geo',
label: {
show: true
},
labelLayout: {
hideOverlap: true
},
data: [
{ name: 'Central and Western District', value: 20057.34 },
{ name: 'Wanchai', value: 15477.48 },
{ name: 'Eastern District', value: 31686.1 },
{ name: 'Southern District', value: 6992.6 },
{ name: 'Yau Tsim Wang', value: 44045.49 },
{ name: 'Sham Shui Po', value: 40689.64 },
{ name: 'Kowloon City', value: 37659.78 },
{ name: 'Wong Tai Sin', value: 45180.97 },
{ name: 'Kwun Tong', value: 55204.26 },
{ name: 'Kwai Tsing', value: 21900.9 },
{ name: 'Tsuen Wan', value: 4918.26 },
{ name: 'Tuen Mun', value: 5881.84 },
{ name: 'Yuen Long', value: 4178.01 },
{ name: 'North District', value: 2227.92 },
{ name: 'Tai Po', value: 2180.98 },
{ name: 'Shatin', value: 9172.94 },
{ name: 'Saigon', value: 3368 },
{ name: 'Outlying Island', value: 806.98 }
],
// Custom name mapping
nameMap: {
'Central and Western': 'Central and Western District',
Eastern: 'Eastern District',
Islands: 'isolated islands',
'Kowloon City': 'Kowloon City',
'Kwai Tsing': 'Kwai Tsing',
'Kwun Tong': 'Kwun Tong',
North: 'Northern District',
'Sai Kung': 'Sai Kung',
'Sha Tin': 'Sha Tin',
'Sham Shui Po': 'Sham Shui Po',
Southern: 'Southern District',
'Tai Po': '大波',
'Tsuen Wan': 'Tsuen Wan',
'Tuen Mun': 'Tuen Mun',
'Wan Chai': 'Wan Chai',
'Wong Tai Sin': 'Wong Tai Sin',
'Yau Tsim Mong': 'Yau Tsim Mong',
'Yuen Long': 'Yuen Long'
}
}
]
})
);
}); Current BehaviorExpected BehaviorIt is expected that LabelLayout can take effect normally Environment-OS:win10
- Browser:chrome
- Framework: Any additional comments?No response |
geo is an optional coordinate system parameter. In most cases it's redundant. 📌 please close issue if problem solved. |
You are right, hideOverlap works fine with no geoIndex. |
If it is style, maps have it too - itemStyle.
Yes, geo is required for series other than map. |
Version
5.5.1
Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?c=map-HK
Steps to Reproduce
Current Behavior
Expected Behavior
期望 LabelLayout 可以正常生效
注:不配置 geoIndex 是正常的,配置之后就不行了
Environment
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: