flat: 暂存 添加定位处理70%,key达上限未测
This commit is contained in:
27
untils/addressToLocation.js
Normal file
27
untils/addressToLocation.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
getAddresscoder
|
||||
} from '@/api/map.js'
|
||||
|
||||
const key = 'FW3BZ-6JTK6-GCUS5-MZCRR-3GPR5-HJFEI'
|
||||
|
||||
export function AddressToLocation({
|
||||
smart_address,
|
||||
address = '',
|
||||
get_poi = 0
|
||||
}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let params = {
|
||||
smart_address,
|
||||
// address,
|
||||
key: encodeURI(key),
|
||||
get_poi
|
||||
}
|
||||
getAddresscoder(params).then((resData) => {
|
||||
if (resData.status === 0) {
|
||||
resolve(resData.result)
|
||||
} else {
|
||||
reject(false)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user