修改
This commit is contained in:
parent
7737c228ec
commit
0481e0225a
@ -165,8 +165,8 @@ export const useEcharts = (elRef, theme = 'default') => {
|
|||||||
clear && chartInstance?.clear();
|
clear && chartInstance?.clear();
|
||||||
|
|
||||||
chartInstance?.setOption(unref(getOptions));
|
chartInstance?.setOption(unref(getOptions));
|
||||||
chartInstance.off('click'); // [!code ++]
|
chartInstance.off('click');
|
||||||
chartInstance.on('click', handleMapClick); // [!code ++]
|
chartInstance.on('click', handleMapClick);
|
||||||
}, 30);
|
}, 30);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -188,7 +188,19 @@ export const useEcharts = (elRef, theme = 'default') => {
|
|||||||
|
|
||||||
console.info('getMap', echarts.getMap(mapName));
|
console.info('getMap', echarts.getMap(mapName));
|
||||||
if (!echarts.getMap(mapName)) {
|
if (!echarts.getMap(mapName)) {
|
||||||
echarts.registerMap(mapName, geoJSON);
|
echarts.registerMap(mapName, geoJSON, { override: true });
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
if (chartInstance && cacheOptions.value.geo?.map === mapName) {
|
||||||
|
chartInstance.setOption(
|
||||||
|
{
|
||||||
|
geo: { map: mapName },
|
||||||
|
geo3D: { map: mapName },
|
||||||
|
},
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user