|
isCircleContainsPoint 调用之后 没有返回 也不报错
//获取当前地理位置
function getlocation(){
aMap.getLocation(function(ret, err) {
if (ret.status) {
// console.log(JSON.stringify(ret));
aMap.getNameFromCoords({
lon: ret.lon,
lat: ret.lat
}, function(ret, err) {
if (ret.status) {
// console.log(JSON.stringify(ret));
Zepto('#addr').html(ret.address);
} else {
// console.log(JSON.stringify(err));
api.toast({
msg: '解析地址失败,请稍后再试。',
duration: 2000,
location: 'bottom'
});
}
});
//判断是否在考勤范围内
aMap.isCircleContainsPoint({
point: {
lon: ret.lon,
lat: ret.lat
},
circle: {
center: {
lon: 116.802,
lat: 35.752
},
radius: 200
}
}, function(ret) {
console.log(JSON.stringify(ret));
// return ret.status;
});
// if(isInCircle){
// Zepto('#zcdk').show();
// Zepto('#wqdk').hide();
// Zepto('#info').hide();
// }
// else{
// Zepto('#zcdk').hide();
// Zepto('#wqdk').show();
// Zepto('#info').show();
// }
} else {
// console.log(JSON.stringify(err));
alert("定位失败,请确认手机时候打开定位权限!");
}
})
} |
|