小白啊
小白啊
  • 发布:2018-03-28 12:41
  • 更新:2018-03-28 12:41
  • 阅读:1293

ios 获取到经纬度后无法转换位置信息

分类:HTML5+

map.getUserLocation(function(state,point){
if (0 == state) {
pcenter = new plus.maps.Point(point.longitude, point.latitude);
map.centerAndZoom(pcenter,18);

            alert(point.longitude+","+point.latitude);  

            plus.maps.Map.reverseGeocode(point,{},function(event){  
                var address = event.address; // 转换后的地理位置  

                $('.titye').val(address);//记录上传地址  
                $('.longitude_and_latitude').val(point.longitude+","+point.latitude);//记录上传经纬度  
                $('.prompt').text("位置信息:"+address);  

                alert(JSON.stringify(event));  
            });  
            plus.nativeUI.closeWaiting();  
        } else {  
            map.centerAndZoom(new plus.maps.Point(116.3977, 39.906016), 12); //指定默认地址  
            plus.nativeUI.alert('获取定位位置信息失败,请重新定位!');//定位异常  
            plus.nativeUI.closeWaiting();  
            titye = '';//根据经纬度得到地址  
            longitude_and_latitude  = '';//记录的经纬度  
            $('.div_css').css('display','block');//显示地图加载失败提示  
        }  
    });
2018-03-28 12:41 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复