map.getUserLocation(function(state,pos){
if(0==state){
map.setCenter(pos);
var point = new plus.maps.Point(JSON.stringify(pos.longitude),JSON.stringify(pos.latitude));
mui.alert(point);
plus.maps.Map.reverseGeocode(point,{},function(event){
var address = event.address; // 转换后的地理位置
var point = event.coord; // 转换后的坐标信息
var coordType = event.coordType; // 转换后的坐标系类型
$("#address").html('您当前的位置是:'+address);
mui.ajax("",{
data:{
flag:3,
aflag:aflag,
time:now,
phone_id:plus.device.uuid,
device:plus.device.vendor + ',' + plus.device.model + ',' + plus.os.version,
address:address
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
success:function(data){
if(data.state=='ok'){
mui.toast('签到成功!',{ duration:'long', type:'div' }) ;
if(parseInt(aflag)==1){
document.getElementById("time_btn"+parseInt(aflag)).value=data.info.attend[0].atime_state;
}else{
document.getElementById("time_btn"+parseInt(aflag)).value=data.info.attend[parseInt(aflag)-2].atime_state;
}
}else if(data.state=='repeat'){
mui.toast('您已签到,请不要重复签到!',{ duration:'long', type:'div' }) ;
}
},
error:function(e){
mui.toast('网络请求失败!',{ duration:'long', type:'div' }) ;
}
});
},function(e){
//mui.toast('定位失败了!',{ duration:'long', type:'div' }) ;
alert("Failed:"+JSON.stringify(e));
});
4***@qq.com
- 发布:2017-08-10 11:36
- 更新:2018-03-28 17:29
- 阅读:1859
引用第三方地图定位之后用reverseGeocode()转码,ios报-100
分类:HTML5+