提交 e5928319 编写于 作者: Q qiang

feat(App): getLocation add errCode

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