JasonThomasData / DocLink

Web app (Rails) for refugees to find bulk-billing doctors nearby
0 stars 1 forks source link

Add find my location button #8

Closed JasonThomasData closed 8 years ago

JasonThomasData commented 8 years ago

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.

JasonThomasData commented 8 years ago

Jason is looking into this. Will need to know where to put this in the app.

JasonThomasData commented 8 years ago

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.

JasonThomasData commented 8 years ago

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.

JasonThomasData commented 8 years ago

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?

JasonThomasData commented 8 years ago

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.

JasonThomasData commented 8 years ago

Also need to test on other browsers, as this computer only has Firefox GRR

equivalentideas commented 8 years ago

Hey @equivalentideas can you help me brainstorm here.

Awesome, I've assigned the PR to me and we can pick up the discussion there 👍

JasonThomasData commented 8 years ago

Closed by #27