plus.geolocation.getCurrentPosition提示无法获取有效的位置信息,android版本5.1,内核版本3.10.65;当使用android版本4.4.4,内核版本3.10.28正常,为什么啊?和手机的版本有关系吗?请求官方人员的帮助

我不是风
- 发布:2016-06-16 16:55
- 更新:2016-06-17 15:25
- 阅读:1079
HTML5+ Geolocation模块管理设备位置信息
分类:HTML5+
我不是风 (作者)
打包之后会这样,真机调试正常;代码是下面的```javascript
plus.geolocation.getCurrentPosition(function (p) {
gpsx = p.coords.longitude;
gpsy = p.coords.latitude;
//var coords = cts.wgs84ToTj90([p.coords.longitude,p.coords.latitude]);
var coords = webgis.wgs84ToTj90([p.coords.longitude,p.coords.latitude]);
x = coords[0];
y = coords[1];
webgis.setCurrentLocation(p.coords.longitude,p.coords.latitude);
//webgis.setCurrentLocation(117.14819613690125,39.231554362887984);
webgis.showCurrentLocation(); //在地图上定位这个位置
getNearData();
}, function ( e ) {
// console.log("Gelocation Error: code - "+e.code+"; message - "+e.message);
switch(e.code) {
case e.PERMISSION_DENIED:
plus.nativeUI.toast('系统不允许程序获取定位功能');
break;
case e.POSITION_UNAVAILABLE:
plus.nativeUI.toast('无法获取有效的位置信息');
break;
case e.TIMEOUT:
plus.nativeUI.toast('获取位置信息超时');
break;
case e.UNKNOWN_ERROR:
plus.nativeUI.toast('其它未知错误导致无法获取位置信息');
break;
default:
plus.nativeUI.toast(e.message);
}
}, {
enableHighAccuracy: false,
timeout: 20000,
maximumAge: 0,
provider: 'system',
geocode: false
})
2016-06-17 15:27