fix: 修复不显示南海群岛时的小方块

This commit is contained in:
tnt group 2022-09-06 12:49:25 +08:00
parent 05a048e5a8
commit 7fa4319bd1
3 changed files with 7 additions and 11 deletions

View File

@ -36,7 +36,7 @@ export const option = {
{
name: '地图',
type: 'map',
map: 'chinaWithoutHainanIsLands',
map: 'china',
zoom: 1, //缩放
itemStyle: {
// 背景色
@ -50,7 +50,7 @@ export const option = {
color: '#ffffff',
borderColor: '#75ecaa',
borderWidth: 1,
showHainanIsLands: true // 是否显示南群岛
showHainanIsLands: true // 是否显示群岛
},
label: {
show: true,

View File

@ -45,7 +45,7 @@
</SettingItemBox>
<SettingItemBox name="其他">
<SettingItem>
<n-checkbox v-model:checked="seriesList[1].itemStyle.showHainanIsLands" size="small">显示南群岛</n-checkbox>
<n-checkbox v-model:checked="seriesList[1].itemStyle.showHainanIsLands" size="small">显示群岛</n-checkbox>
</SettingItem>
</SettingItemBox>
</CollapseItem>

View File

@ -45,7 +45,6 @@ use([
])
registerMap('china', { geoJSON: mapJson as any, specialAreas: {} })
registerMap('chinaWithoutHainanIsLands', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
const option = reactive({
value: mergeTheme(props.chartConfig.option, props.themeSetting, includes)
@ -59,13 +58,10 @@ const dataSetHandle = (dataset: any) => {
})
}
const mapTypeHandle = (config: boolean) => {
// props.chartConfig.option.series.forEach((item: any) => {
// if (item.type === 'effectScatter' && dataset.point) item.data = dataset.point
// else if (item.type === 'map' && dataset.point) item.data = dataset.map
// option.value = props.chartConfig.option
// })
props.chartConfig.option.series[1].map = config ? 'china' : 'chinaWithoutHainanIsLands'
const mapTypeHandle = (show: boolean) => {
show
? registerMap('china', { geoJSON: mapJson as any, specialAreas: {} })
: registerMap('china', { geoJSON: mapJsonWithoutHainanIsLands as any, specialAreas: {} })
option.value = props.chartConfig.option
}