提交 e5928319 编写于 作者: Q qiang

feat(App): getLocation add errCode

上级 3646b47c
import {
wgs84togcj02,
gcj02towgs84
gcj02towgs84,
warpPlusErrorCallback
} from '../util'
import {
......@@ -53,6 +54,7 @@ export function getLocation ({
geocode = false,
altitude = false
} = {}, callbackId) {
const errorCallback = warpPlusErrorCallback(callbackId, 'getLocation')
plus.geolocation.getCurrentPosition(
position => {
getLocationSuccess(type, position, callbackId)
......@@ -63,10 +65,7 @@ export function getLocation ({
getLocationSuccess(type, e, callbackId)
return
}
invoke(callbackId, {
errMsg: 'getLocation:fail ' + e.message
})
errorCallback(e)
}, {
geocode: geocode,
enableHighAccuracy: altitude
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册