我不是风
(作者)
打包之后会这样,真机调试正常;代码是下面的```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
})
总是返回error方法中的e.POSITION_UNAVAILABLE参数,不知道什么原因
2016-06-17 15:27