HTMLページで地理的な位置を取得しようとすると、次のエラーが発生します。エラーコード:2エラーメッセージ:最後のロケーションプロバイダーはここでは利用できなくなりました。これが私のコードです。
// onSuccess Callback
// This method accepts a `Position` object, which contains
// the current GPS coordinates
//
var onSuccess = function(position) {
};
var HospitalsRecord = [];
//onError Callback receives a PositionError object
//
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
// Cordova is ready
//
function onDeviceReady() {
navigator.geolocation.getCurrentPosition(onSuccess, onError, { maximumAge: Infinity, timeout: 15000, enableHighAccuracy: true });
}
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
</script>
なぜそれが起こっているのですか?
前もって感謝します
コビ