Я хочу задать два вопроса.
- Значение параметра
timeout
находится вseconds
илиmiliseconds
? - Где выполнить код, если дошло
timeout
? (сделайте что-нибудь после тайм-аута)
.
let wait: string;
wait = Plugins.Geolocation.watchPosition({
enableHighAccuracy: true,
timeout:5 // i dont if this is seconds or miliseconds
}, (position, err) => {
// do something
Plugins.Geolocation.clearWatch({
id: wait
});
});
// i want to detect if the location still doesnt detect, and it already time-out, i want to do something
Документ слишком прост. Очень сложно понять. https://capacitor.ionicframework.com/docs/apis/geolocation/