Open
Description
最近我正在尝试在地球仪上按国家显示热度信息,尝试之后发现在2D显示时能够正常使用的提示框组件在地球仪上无法使用。
My tooltip on globe is gone!!!
附上我的配置项代码:
const canvas = ref<HTMLCanvasElement>(document.createElement('canvas'))
const mapChart = echarts.init(canvas.value, null, {
width: '2048',
height: '1024'
})
const mapOption = ref<ECOption>({
tooltip:{
show: true,
trigger: 'item',
triggerOn:'mousemove|click',
formatter: '{b}: {c}'
},
series: [
{
type:'map',
map: 'world',
data: [
{name: '中国', value: 1392},
],
zoom: 1,
zlevel: 1,
z: 2
}
],
backgroundColor: '#6060ff',
visualMap: {
min: 0,
max: 100,
rangeText: ['High', 'Low'],
},
nameMap: {
'China': '中国'
}
})
const chart = ref<HTMLDivElement>()
const option = ref<ECOption>({
globe: {
globeRadius: 100,
globeOuterRadius: 110,
baseTexture: mapChart,
shading: 'color',
viewControl: {
projection: 'perspective',
alpha: 15,
beta: 175,
autoRotate: false,
autoRotateSpeed: 5,
autoRotateAfterStill: 2,
distance: 160,
}
}
})
const drawMap = () => {
mapChart.setOption(mapOption.value)
}
const loadMap = () => {
axios.get('/json/world.json').then(({data, status}) => {
if (status !== 200) return
echarts.registerMap('world', data)
drawMap()
})
}
onBeforeMount(() => {
loadMap()
})
onMounted(() => {
echarts.init(chart.value).setOption(option.value, true)
})
如果目前地球仪上使用2D地图存在能够正常使用提示框组件的方法,烦请指教。
If has the way to show tooltip, teach me please.
如果目前地球仪上并没有实现2D地图的提示框组件,烦请告知。
If has no way to show, please tell me.
谢谢。
Thanks.
Metadata
Metadata
Assignees
Labels
No labels