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)
            }
        })
    })
}