我使用cordova-2.0.0和
android模拟器google api level16.
每当我运行navigator.geolocation.getCurrentPosition我总是得到错误3.
我的代码简介如下:
// Wait for Cordova to load
document.addEventListener("deviceready",onDeviceReady,false);
// Cordova is ready
function onDeviceReady() {
console.log("Entering index.html.onDeviceReady");
var networkState = navigator.network.connection.type;
getPosition(networkState);
}
function getPosition(networkState) {
console.log("Entering getPosition function");
console.log("networkState is: " + networkState);
if (networkState !== null) {
navigator.geolocation.getCurrentPosition(onSuccess,onError,{
maximumAge : Infinity,timeout : 5000,enableHighAccuracy : true
});
} else {
alert(