mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 16:22:57 +08:00
feat: 高德地图新增属性
This commit is contained in:
parent
ab8f5d123b
commit
e89dc9d0e7
@ -12,6 +12,9 @@ export const option = {
|
|||||||
amapLon: 116.39,
|
amapLon: 116.39,
|
||||||
amapLat: 40.91,
|
amapLat: 40.91,
|
||||||
amapZindex: 10,
|
amapZindex: 10,
|
||||||
|
viewMode: '2D',
|
||||||
|
pitch: 60,
|
||||||
|
skyColor: '#53A9DE',
|
||||||
lang: 'zh_cn',
|
lang: 'zh_cn',
|
||||||
features: ['bg', 'point', 'road', 'building']
|
features: ['bg', 'point', 'road', 'building']
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,29 @@
|
|||||||
<n-input-number v-model:value="optionData.amapZindex" size="small"></n-input-number>
|
<n-input-number v-model:value="optionData.amapZindex" size="small"></n-input-number>
|
||||||
</setting-item>
|
</setting-item>
|
||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
|
<setting-item-box name="展示模式" :alone="true">
|
||||||
|
<setting-item>
|
||||||
|
<n-radio-group v-model:value="optionData.viewMode" name="radiogroup">
|
||||||
|
<n-space>
|
||||||
|
<n-radio v-for="song in viewModeOptions" :key="song.value" :value="song.value">
|
||||||
|
{{ song.label }}
|
||||||
|
</n-radio>
|
||||||
|
</n-space>
|
||||||
|
</n-radio-group>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
<template v-if="optionData.viewMode === '3D'">
|
||||||
|
<setting-item-box name="天空色" :alone="true">
|
||||||
|
<setting-item>
|
||||||
|
<n-color-picker size="small" :modes="['hex']" v-model:value="optionData.skyColor"></n-color-picker>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
<setting-item-box name="俯仰角" :alone="true">
|
||||||
|
<setting-item>
|
||||||
|
<n-input-number v-model:value="optionData.pitch" :min="0" :max="83" size="small"></n-input-number>
|
||||||
|
</setting-item>
|
||||||
|
</setting-item-box>
|
||||||
|
</template>
|
||||||
</collapse-item>
|
</collapse-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -71,6 +94,16 @@ const langOptions = ref([
|
|||||||
label: '中英文对照'
|
label: '中英文对照'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
const viewModeOptions = ref([
|
||||||
|
{
|
||||||
|
value: '2D',
|
||||||
|
label: '2D'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '3D',
|
||||||
|
label: '3D'
|
||||||
|
}
|
||||||
|
])
|
||||||
const featuresOptions = ref([
|
const featuresOptions = ref([
|
||||||
{
|
{
|
||||||
value: 'bg',
|
value: 'bg',
|
||||||
|
@ -14,16 +14,26 @@ const props = defineProps({
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let { amapKey, amapStyleKey, amapLon, amapLat, amapZindex, lang, amapStyleKeyCustom, features } = toRefs(
|
let {
|
||||||
props.chartConfig.option
|
amapKey,
|
||||||
)
|
amapStyleKey,
|
||||||
|
amapLon,
|
||||||
|
amapLat,
|
||||||
|
amapZindex,
|
||||||
|
lang,
|
||||||
|
amapStyleKeyCustom,
|
||||||
|
features,
|
||||||
|
viewMode,
|
||||||
|
pitch,
|
||||||
|
skyColor
|
||||||
|
} = toRefs(props.chartConfig.option)
|
||||||
|
|
||||||
let map = shallowRef(null)
|
let map = shallowRef(null)
|
||||||
|
|
||||||
const ininMap = () => {
|
const ininMap = () => {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: amapKey.value, //api服务key--另外需要在public中使用安全密钥!!!
|
key: amapKey.value, //api服务key--另外需要在public中使用安全密钥!!!
|
||||||
version: '1.4.4', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
version: '1.4.8', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
|
||||||
plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete'] // 需要使用的的插件列表
|
plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete'] // 需要使用的的插件列表
|
||||||
})
|
})
|
||||||
.then(AMap => {
|
.then(AMap => {
|
||||||
@ -33,7 +43,10 @@ const ininMap = () => {
|
|||||||
center: [amapLon.value, amapLat.value],
|
center: [amapLon.value, amapLat.value],
|
||||||
mapStyle: `amap://styles/${amapStyleKeyCustom.value !== '' ? amapStyleKeyCustom.value : amapStyleKey.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 度
|
||||||
|
skyColor: skyColor.value,
|
||||||
|
viewMode: viewMode.value, // 地图模式
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(e => {})
|
.catch(e => {})
|
||||||
|
Loading…
Reference in New Issue
Block a user