1.0.11 • Published 8 months ago
@szlx/location v1.0.11
内部统一定位调用工具
Installtion
npm i @szlx/uni-location
Usage
import { getLocation, onLocationChange } from '@szlx/uni-location'
// 配置项
const options = {
provider: 'amap',
enableHighAccuracy: true,
maximumAge: 3000,
timeout: 30000,
geocode: false
}
// 获取定位
getLocation(options).then(d => {}).catch(e => {]})
// 监听定位
onLocationChange({
options,
success: d => {},
fail: e => {}
})