Open joaoluis-pdm opened 2 years ago
In the last commit, the location is already cached, but some sort of timer needs to be set for that cache to be forgotten. For example, if the patient leaves the app open for a day or more, the location might change significantly.
At this line, https://github.com/PharmaLedger-IMI/ctr-workspace/blob/5fd2eb378c9e230c5665928569752d93c4f2afef/ctr-patient/patient-ssapp/code/scripts/controllers/ClinicalTrialAns40TrialController.js#L66 the self.matchRequest.coords are {}. Why ? (This prevents the matched trial from displaying travel distances).
Apparently the coords: GeolocationCoordinates object (which is browse-native) does survive a setState/getState.
Could be a firefox-only problem: https://stackoverflow.com/questions/11042212/ff-13-ie-9-json-stringify-geolocation-object
Problem worked around in the previous commit.
Instead of having the browser always asking the user for geoLocation permission, cache last successful geoLocation.