Version
5.5.0
Link to Minimal Reproduction
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: 'Pop.Density HK 2011'
},
visualMap: {
min: 800,
max: 50000,
text: ['High', 'Low'],
realtime: true,
calculable: true,
seriesIndex: 0,
inRange: {
color: ['lightskyblue', 'yellow', 'orangered']
}
},
tooltip: {
trigger: 'item',
formatter: '{c} alt'
},
legend: {},
geo3D: {
// emphasis works in geo3D, select,click do not
//show: false, // comment out to show, but hide map3D
map: 'HK',
roam: true,
zlevel: 13,
label: { show: false },
emphasis: {
itemStyle: {
color: 'yellow'
}
},
itemStyle: {
//borderWidth: 0.5,
opacity: 0.01 // important!
},
//selectedMode: true // just a test
//shading: 'lambert',
},
series: [
{ // tooltip, click and itemStyle.emphasis do not work
name: 'map',
type: 'map3D',
map: 'HK', // comment out to hide
zlevel: 5,
emphasis: {
itemStyle: {
color: 'yellow',
opacity: 1
}
},
data: [
{ name: '中西区', value: 20057.34 },
{ name: '湾仔', value: 15477.48 },
{ name: '东区', value: 31686.1 },
{ name: '南区', value: 6992.6 },
{ name: '油尖旺', value: 44045.49 },
{ name: '深水埗', value: 40689.64 },
{ name: '九龙城', value: 37659.78 },
{ name: '黄大仙', value: 45180.97 },
{ name: '观塘', value: 55204.26 },
{ name: '葵青', value: 21900.9 },
{ name: '荃湾', value: 4918.26 },
{ name: '屯门', value: 5881.84 },
{ name: '元朗', value: 4178.01 },
{ name: '北区', value: 2227.92 },
{ name: '大埔', value: 2180.98 },
{ name: '沙田', value: 9172.94 },
{ name: '西贡', value: 3368 },
{ name: '离岛', value: 806.98 }
],
nameMap: {
'Central and Western': '中西区',
Eastern: '东区',
Islands: '离岛',
'Kowloon City': '九龙城',
'Kwai Tsing': '葵青',
'Kwun Tong': '观塘',
North: '北区',
'Sai Kung': '西贡',
'Sha Tin': '沙田',
'Sham Shui Po': '深水埗',
Southern: '南区',
'Tai Po': '大埔',
'Tsuen Wan': '荃湾',
'Tuen Mun': '屯门',
'Wan Chai': '湾仔',
'Wong Tai Sin': '黄大仙',
'Yau Tsim Mong': '油尖旺',
'Yuen Long': '元朗'
},
selectedMode: true,
instancing: true,
label: {
show: true,
textStyle: {
color: 'black', //#fff',
fontWeight: 'bold',
fontSize: 12,
backgroundColor: 'rgba(0,23,11,0)'
}
},
itemStyle: {
opacity: 1,
borderWidth: 0.5,
emphasis: {
color: 'green'
}
},
shading: 'lambert',
light: {
main: {
color: '#fff',
intensity: 0.8,
shadow: true,
shadowQuality: 'height',
alpha: 40,
beta: 10
},
ambient: {
intensity: 0.5
}
}
},
{
type: 'scatter3D',
name: 'points',
coordinateSystem: 'geo3D',
symbol: 'path://M 10,30 A 20,20 0,0,1 50,30 A 20,20 0,0,1 90,30 Q 90,60 50,90 Q 10,60 10,30 z',
symbolSize: [44, 44],
itemStyle: { color: 'blue', opacity: 1 },
zlevel: 111,
emphasis: {
itemStyle: {
color: 'red'
}
},
data: [
[114.120415, 22.282639, 10],
[114.220415, 22.282639, 222]
]
}
]
})
);
});
myChart.on('click', (p) => {
//if (p.seriesType=="scatter3D")
console.log('pnt '+p.dataIndex);
});
myChart.on('georoam', (p) => {
//if (p.seriesType=="scatter3D")
console.error(p);
});
Current Behavior
1、geo3D中 无法监听到 georoam事件
2、scatter3D中data点位数量必须要2个或2个以上才能触发click点击事件,当只有一个的时候无法触发click事件
Expected Behavior
1、希望能够再geo3D中 监听到 georoam事件
2、scatter3D中data点位数量为什么必须要2个或2个以上才能触发click点击事件
3、鼠标滚轮滚动,能够实时获取到地图放大缩小的zoom值
Environment
- OS:windows 11
- Browser: chrome 122.0.6261.129
- Framework: Vue@2
Any additional comments?
No response
2条答案
按热度按时间vjrehmav1#
@swanghao 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. 🤗
TRANSLATED
TITLE
[Bug] Geo3D cannot listen to georoam events
5ssjco0h2#
not-a-bug, georoam is just not an event defined in echarts-gl , it is for 2D maps only.