|
var bMap = api.require('bMap');
bMap.getLocation({
accuracy: '10m',
autoStop: false,
enableLocInForeground: true,
filter: 1,
notification: {
id: 9, //(必选项) 数字类型;为通知栏notifation设置唯一id,必须大于0
contentTitle: api.appName,//(必选项) 字符串类型;标题
contentText: api.appName + '后台获取定位' //(必选项) 字符串类型;内容
}
}, function (ret, err) {
if (ret.status) {
alert(JSON.stringify(ret));
} else {
alert(err.code);
}
}) |
|