8
Jak przekazać jeden lub więcej parametrów do połączenia z sukcesem, dzwoniąc pod numer navigator.geolocation.getcurrentPosition
?Jak przekazać parametry, aby oddzwonić z powodzenia getCurrentPosition?
Jak mogę przekazać deviceready
z metody foundLoc
na getGeoLoc
?
var app = {
onDeviceReady: function() {
alert = window.alert || navigator.notification.alert;
app.getGeoLoc('deviceready');
},
getGeoLoc: function (id) {
navigator.geolocation.getCurrentPosition(this.foundLoc, this.noLoc, { timeout: 3 });
},
foundLoc: function (position) {
var parentElement = document.getElementById('deviceready');
var lat = parentElement.querySelector('#lat');
var long = parentElement.querySelector('#long');
lat.innerHTML = position.coords.latitude;
long.innerHTML = position.coords.longitude;
},
noLoc: function() {
alert('device has no GPS or access is denied.');
}
};
Natknąłem się na to i na pewno pomogło. +1 dla Ciebie :) –