Closed justkapoor closed 3 years ago
My implementation is like: I get the current position & subscribe to watch so as to get the updated position. Below are the programs used for Getting one time location & subscribing to wachposition. Please help me in the fixing the issue.
const getOneTimeLocation = () => { Geolocation.getCurrentPosition( //Will give you the current location (position) => { console.log(position, 35); setCurrentLat(position.coords.latitude); setCurrentLng(position.coords.longitude); }, (error) => { console.warn(error, 38); }, { enableHighAccuracy: true, timeout: 15000, maximumAge: 0, forceRequestLocation: true, showLocationDialog: true, accuracy: 5 }, ); }; const subscribeLocationLocation = () => { watchID = Geolocation.watchPosition( (position) => { console.log(position, 51); setCurrentLat(position.coords.latitude); setCurrentLng(position.coords.longitude); }, (error) => { console.warn(error, 54); }, { enableHighAccuracy: true, timeout: 15000, maximumAge: 0, forceRequestLocation: true, showLocationDialog: true, accuracy: 5 }, ); setWatchId(watchID); };
Hi @justkapoor How did you solve this issue can you please send me code ?
My implementation is like: I get the current position & subscribe to watch so as to get the updated position. Below are the programs used for Getting one time location & subscribing to wachposition. Please help me in the fixing the issue.