上传
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
|
||||
<script setup name="ClueMap">
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getConfigByConfigKey } from '@/api/system/set'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
@@ -69,9 +70,17 @@ const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
})
|
||||
const defaultCity = ref('合肥')
|
||||
|
||||
let AutoComplete = ref(null)
|
||||
function initMap() {
|
||||
async function initMap() {
|
||||
const data = await getConfigByConfigKey({ configKey: 'defaultLocation' })
|
||||
const cityInfo = JSON.parse(data.configValue)
|
||||
defaultLatLng.value = {
|
||||
lat: cityInfo.lat,
|
||||
lng: cityInfo.lng
|
||||
}
|
||||
defaultCity.value = cityInfo.locationName
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
version: '2.0',
|
||||
@@ -79,7 +88,7 @@ function initMap() {
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '合肥'
|
||||
city: defaultCity.value
|
||||
})
|
||||
clueMap.value = new AMap.Map('mapClue', {
|
||||
zoom: 14,
|
||||
|
||||
Reference in New Issue
Block a user