mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-03 12:19:07 +08:00
parent
346c8d439a
commit
bcb2ca1cb5
@ -16,7 +16,8 @@ export enum ThemeEnum {
|
|||||||
MACARON = 'macaron',
|
MACARON = 'macaron',
|
||||||
BLUE = 'blue',
|
BLUE = 'blue',
|
||||||
DARKBLUE = 'darkblue',
|
DARKBLUE = 'darkblue',
|
||||||
WINE = 'wine'
|
WINE = 'wine',
|
||||||
|
WEIXIN = 'tileLayer'
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LangEnum {
|
export enum LangEnum {
|
||||||
|
@ -134,6 +134,10 @@ const themeOptions = [
|
|||||||
{
|
{
|
||||||
value: ThemeEnum.WINE,
|
value: ThemeEnum.WINE,
|
||||||
label: '酱籽'
|
label: '酱籽'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: ThemeEnum.WEIXIN,
|
||||||
|
label: '卫星'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import AMapLoader from '@amap/amap-jsapi-loader'
|
|||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { useChartDataFetch } from '@/hooks'
|
import { useChartDataFetch } from '@/hooks'
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { MarkerEnum } from './config'
|
import { MarkerEnum, ThemeEnum } from './config'
|
||||||
import { isArray } from '@/utils'
|
import { isArray } from '@/utils'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -51,7 +51,6 @@ const initMap = (newData: any) => {
|
|||||||
resizeEnable: true,
|
resizeEnable: true,
|
||||||
zoom: amapZindex.value, // 地图显示的缩放级别
|
zoom: amapZindex.value, // 地图显示的缩放级别
|
||||||
center: [amapLon.value, amapLat.value],
|
center: [amapLon.value, amapLat.value],
|
||||||
mapStyle: `amap://styles/${amapStyleKeyCustom.value !== '' ? amapStyleKeyCustom.value : amapStyleKey.value}`, //自定义地图的显示样式
|
|
||||||
lang: lang.value,
|
lang: lang.value,
|
||||||
features: features.value,
|
features: features.value,
|
||||||
pitch: pitch.value, // 地图俯仰角度,有效范围 0 度- 83 度
|
pitch: pitch.value, // 地图俯仰角度,有效范围 0 度- 83 度
|
||||||
@ -60,6 +59,14 @@ const initMap = (newData: any) => {
|
|||||||
willReadFrequently: true
|
willReadFrequently: true
|
||||||
})
|
})
|
||||||
dataHandle(props.chartConfig.option.dataset)
|
dataHandle(props.chartConfig.option.dataset)
|
||||||
|
let satellite = new AMap.TileLayer.Satellite()
|
||||||
|
let roadNet = new AMap.TileLayer.RoadNet()
|
||||||
|
if (newData.amapStyleKey === ThemeEnum.WEIXIN) {
|
||||||
|
mapIns.add([satellite, roadNet])
|
||||||
|
} else {
|
||||||
|
mapIns.remove([satellite, roadNet])
|
||||||
|
mapIns.setMapStyle(`amap://styles/${amapStyleKeyCustom.value !== '' ? amapStyleKeyCustom.value : amapStyleKey.value}`)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(e => {})
|
.catch(e => {})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user