Closed JasonThomasData closed 8 years ago
Jason is looking into this. Will need to know where to put this in the app.
I now think the best way to do this is to have a 'find my location' button on page load. From reading the docs, html5 will use the GPS location if it's available. If not, it uses the nearest wifi or phone tower's address. We could assume this method will be accurate to the suburb level.
This should only be on the landing page. I previously said we should do the geolocate on page load. I now think that's a bad idea because if you are a case worker trying to help a refugee, your location is irrelevant.
Also, this is best handled with JavaScript since the location is client side, so this is why I want to use jquery, for the event listener functions.
Hey @equivalentideas can you help me brainstorm here.
I intend change the router so it loads a different view on root. This will be the same as the search view but has a button to find the person's address.
This button will use JS to geolocate the user but it should only be available from root, hence the view change.
The JavaScript will take the address from Google's geolocator and put that in the search field. Should we also click the button for them?
Is this a good approach?
I've added the button, see the PR.
I need to add some error handling, other than the alert box I've got currently, as I think this looks bad.
Also need to test on other browsers, as this computer only has Firefox GRR
Hey @equivalentideas can you help me brainstorm here.
Awesome, I've assigned the PR to me and we can pick up the discussion there 👍
Closed by #27
A user will want to know which doctors are close to them, so they can make an appointment and get there quickly. A user preferably won't need to input their location by default.