code-for-chapel-hill / NC-COVID-Support

Community support site, supporting COVID-19 business opening hours, Food Banks, School Meals, Farms and Social Services.
https://nccovidsupport.org
GNU General Public License v3.0
16 stars 39 forks source link

Request to know user's location (as a way to center the map for the user & suggest nearby resources) #108

Closed KM-Hanson closed 4 years ago

KM-Hanson commented 4 years ago

**Have an idea for an additional feature? (a) Describe the feature**

Would it be possible to determine a user's location & then ask permission to use that location to adjust their experience?

(b) How does it need to perform?

If a user allows access to their location, then (1) the map could move to a centroid near that location as the default view (1) resources could be sorted based on geographic proximity

(c) How will we code it?

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

readingdancer commented 4 years ago

Yes this is possible, there are plugins for leafletjs that do this :)

I suggest splitting this into two tickets, one for adding the geo-location and a second for the ordering based on the current location as that is going to prove more problematic when you factor in how the rest of the code works with the list and selected business.

readingdancer commented 4 years ago

@KM-Hanson - I created a new ticket to split this request into two distinct bits of functionality and have already implemented a solution to this new ticket, I will hopefully put it live tomorrow.

Sort resources based on geographic proximity

cw2908 commented 4 years ago

Hi,

I can take this issue. I was able to find the solution.

readingdancer commented 4 years ago

This PR fixes this item: https://github.com/code-for-chapel-hill/NC-COVID-Support/pull/224

It was mainly written by @cw2908 and then enhanced by @eparadise and editing by @readingdancer , a great team effort :)

readingdancer commented 4 years ago

@all-contributors add @cw2908 to code

allcontributors[bot] commented 4 years ago

@readingdancer

I've put up a pull request to add @cw2908! :tada: