This component change the current location services (Algolia) to MapBox. The old service was shutting down in May-2022, but still working until September. See more details in Algolia web site
Screenshot of OssnLocation
Screenshot of OssnLocation admin
Installation procedures as the same for any component in OSSN. Also, it's required to admin put the MapBox API Access Token into OssnLocation admin page.
Just go to this page.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
I would like to know why the choice of mapbox instead of google maps, knowing that the latter also offers a free solution, and it has a more sophisticated presentation
Making this a obsolete as added in core , to avoid people downloading different version
Ossn is a revolutionary new way to store your personal items. With its patented design, Ossn takes up no space, is portable, and can be folded into itself. Ossn is a small yet powerful item storage solution that can hold items ranging from clothing to shoes.
Thank you for the tips, @Michael
localization to the global site language doesn't work this way
because it will be replaced by the member's individual language
see function at line #320 in ossn.lib.users and line #498 where it's called by hook
see #343 in ossn.lib.system where the global setting gets finally changed
so the only way to retrieve the orignal value I see would be
language: '<?php $ossnsite = new OssnSite(); echo $ossnsite->getSettings("language"); ?>',
Next I would vote to load external libs not on the frontpage (if the user is still logged off) because this might lead to GDPR compliance issues
At least in Germany the visitor has to explicitely agree that his browser data will be sent to 3rd-parties.
Solution founded using https://gomakethings.com/detecting-click-events-on-svgs-with-vanilla-js-event-delegation/ tip. I disable SVG click in CSS. Tomorrow I make more tests here and send a new version. I'm tired, and it's late here (00:26).
I will take it from here no worries, I will push manually to the OSSN after some modifications.
I'm almost finishing version 1.1. The new code is on the github repository for review.
I put a check to prevent errors on pages without the div of the old location code. Also, I added site language as default on Mapbox search/results. And on the last item reported, I can't fix it yet. But the source of error is on the OssnNotification component (https://github.com/opensource-socialnetwork/opensource-socialnetwork/blob/fef86e5bd44606fa4a238d18b845e01c61340943/components/OssnNotifications/plugins/default/js/notifications-settings.php#L9).
At this moment, I accept any thoughts to fix this :-)
A big thank you for making this feature back available, Rafael!
small glitch still: Javascript error on all pages without location input field, and script error when clicking the 'X' in order to remove a chosen city
nice to have: localization. As German users for instance have no chance to get 'München' since the default English localization is expecting 'Munich' to be entered.
I'd suggest to derive it from the site's default language - not the individual member setting - to have a meaningful translation for the majority of members. See https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-geocoder-with-language/