yuy
yuy
  • 发布:2017-09-04 17:30
  • 更新:2017-09-27 16:03
  • 阅读:1078

【报Bug】获取百度定位时,返回coordsType不正确

分类:HTML5+

详细问题描述
使用定位时获取坐标,获取类型不正确(百度定位)

重现步骤
plus.geolocation.getCurrentPosition( function getinfo(position){
console.log(JSON.stringify(position));
}, function ( e ) {
console.log(e.message);
alert( "请打开GPS定位"+ e.message );
},{provider:'baidu'});
}
[结果]
{"coordsType":"gcj02","address":{"country":"中国","province":"四川省","city":"绵阳市","district":"涪城区","street":"涪金东路","streetNum":"","cityCode":"240"},"addresses":"中国四川省绵阳市涪城区涪金东路","coords":{"latitude":31.509716,"longitude":104.65164,"accuracy":71.19651794433594,"altitude":5e-324,"heading":null,"speed":0,"altitudeAccuracy":0},"timestamp":1504517009000} at index.html:16

[期望]
coordsType:bd09ll

运行环境
[系统版本]
windows 8.1
[浏览器版本]
[IDE版本]
8.8.0.201706142254
[mui版本]

附件
[代码片段]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery-1.11.1.js" ></script>
<script type="text/javascript" charset="utf-8">
function onPlusReady() {
plus.geolocation.getCurrentPosition( function getinfo(position){
console.log(JSON.stringify(position));
}, function ( e ) {
console.log(e.message);
alert( "请打开GPS定位"+ e.message );
},{provider:'baidu'});
}

</script>  

</head>
<body>
<div id="min"></div>
<button onclick="onPlusReady()">获取坐标</button>
<div id="allmap"></div>
</body>
</html>
[安装包]

联系方式
[QQ] 1083002349
[电话]15196288651

2017-09-04 17:30 负责人:无 分享
已邀请:
yuy

yuy (作者)

plus.geolocation.getCurrentPosition( function getinfo(position){//坐标获取  
    console.log(JSON.stringify(position));  
}, function ( e ) {                   
    console.log(e.message);  
    plus.nativeUI.toast( "请打开GPS定位"+ e.message );  
},{provider:'baidu',coordsType:"bd09ll"});  

要设置coordsType:"bd09ll"以前是默认是"bd09ll",现在默认不是了;

26348159@qq.com

26348159@qq.com - 开发

顶一个

要回复问题请先登录注册