openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 713 forks source link

Google-free maps #5542

Open Matt-Yorkley opened 4 years ago

Matt-Yorkley commented 4 years ago

I'm adding this issue in the backlog to track any bits people do to move towards OFN being independent of Google Maps. Contributions welcome!

What's been done?

What's still to do now?

Improve map page search bar functionality The current GM implementation only searches by geographic locations. The current OSM implementation only search by OFN enterprise names. The desired implementation includes first - OFN enterprise names that match the search and second - geographic locations that match the search. Apologies that there isn't any design to accompany this issue. If that feels like a blocker feel free to park it.

To do this we will need to create an alternative angular service for geocoding. The /shops search page uses the Geocoding gem and the suggestion from @Matt-Yorkley is to make use of this gem in the same way here, which should enable us to get the old search behaviour back. If we do that we can probably ditch the Autocomplete javascript dependency.

Note that getting rid of angular is on the OFN roadmap. I (@lin-d-hop) would love some insight as to whether it makes more sense to redo /maps with the new stack here or not. Obviously that could explode the scope of this and happy to be led by devs on that while this issue/page isn't on the prioritised pipe.

Issue list

Future issues

Make OSM the default map for new OFN instances on OFN install This should not mean that google maps is impossible to add if a user really needs to use it, however by default the app use OSM, which can be configured in super admin. Note that configuration capability exists in super admin already.

sigmundpetersen commented 4 years ago

Could/should #3179 be attached to this work? (Upgrading the geocoder dependency)

diegoamc commented 2 years ago

Hi!

What is the status of this issue? I would like to help if possible.

Is there a task list on what's left to be done?

Zoyolin commented 9 months ago

Hi it was quite the surprise to find google maps on a "libre" website! I'm happy I found this epic best of luck in this endeavour! Now looking for a more coherent future, I am not myself in a position to help, but I know the OSM community is wide and helpful. So please do reach out for advice if stuck. This change matters. BR.

RachL commented 9 months ago

Hi @Zoyolin thanks for your comment 🤗

Gmaps was used first as 11 years ago in Australia (when OFN was launched) OSM was not accurate / used.

Our community would love to have OSM working now but as you can see there is still a lot to do, so unless a volunteer picks this works up, we need to find funding, which is a long process.

Zoyolin commented 9 months ago

Thanks @RachL. Sorry I didn't realise how global OFN is and how much effort has already been put together to support OSM. I realised Ireland and Belgium's default is already OSM from leaflet. Indeed Australia, UK, France and USA are on ABC's map from Google. Cillian work in https://github.com/openfoodfoundation/openfoodnetwork/pull/5398 mentions introducing an admin setting to select the map provider. I haven't found it (my bad probably) is it available somewhere or is it a buildtime test setting? Cheers

RachL commented 9 months ago

@Zoyolin yes it's a setting you can access as super admin at the bottom of the page /admin/contents/edit

image

But main issue with open street map currently is that the implementation let you search for enterprises, not location (unless you use the scroll). So if you don't know the enterprise name, the search is a bit difficult (although the address of the enterprise shows up in results as well if you type a city for example).

filipefurtad0 commented 8 months ago

yes it's a setting you can access as super admin at the bottom of the page /admin/contents/edit

An additional hint on this: it seems that enabling this option breaks the map around the first step of the enterprise registration process, at /register:

image