-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Geofield and Leaflet modules for maps, to respect user privacy #81
Comments
I'm totally open to this idea; the goal at the time I used Geolocation was to just get a freakin' map working on the event page in time for DrupalCon 😅 I tried with Geofield but I could NOT, for the life of me, figure out how to configure it. In other words, I ran into exactly the kind of problem that Starshot aims to solve. 😎 If you (or someone else?) submits a PR which changes to Geofield and Leaflet, whilst keeping the zero-setup, oh-look-I-immediately-have-a-working-map experience of the Event content type, then I will gladly merge that. |
Sounds fantastic, thanks for being open for this update! And yes, getting all the pieces to fit together for Geocoder, Geofield, et al can be challenging :) I recently documented how to set up Geocoder to work with GPX-files based on a fantastic step-by-step guide by @FMB in Document GPX File Parsing Provider. I would love to try to update the Starshot recipe, but I haven't worked with Recipes yet ... so I would probably have to spend some time understanding how it fits together. So instead of trying to create the new set up in a recipe, I decided to instead document how to set up Geocoder, Geofield and Address module in Using Address module with Geocoder and Geofield, perhaps you could give it a try? After going through the steps in the documentation, to show the map in Starshot, you can add a "Map" block in Layout Builder. Click "Manage Layout" and then:
Please let me know if any of the steps does not make sense, so I can update the documentation, thanks! |
OpenStreetMap, and the sites it contacts are located in these countries outside EU, which conflicts with GDPR compliance:
Still, switching to Geocoder, Geofield and Address will remove the need to contact unpkg.com for the leaflet.js file. |
I checked https://wiki.openstreetmap.org/wiki/Raster_tile_providers and found an alternative tile provider https://openstreetmap.de/, which only contacts a single domain for map tiles, which is openstreetmap.de hosted at Hetzner in Germany. I created the issue Add support for GDPR-friendly openstreetmap.de. Feel free to review, so that we perhaps can use that as map service for tiles in Starshot, with https://www.drupal.org/project/leaflet_more_maps? |
Good news, everyone! Leaflet More Maps 2.2 was just released, and it includes many improvements, among them the option of using openstreetmap.de for Leaflet tiles, completed via Add support for GDPR-friendly openstreetmap.de. |
To respect user privacy, usage of external resources should be kept at a minimum, or avoided entirely.
The Geolocation module contacts the external web site unpkg.com for the https://unpkg.com/leaflet@1.8.0/dist/leaflet.js file, when it shows the map on /event/2024/nasas-boeing-crew-flight-test-launch. The maintainer stated in Allow to choose between local or external libraries that:
So we could instead use Geofield module with the Leaflet module.
Leaflet module does currently contact fastly.net, but as soon as Support serving local scripts first, use CDN as fallback is fixed, Geofield with Leaflet ought to only contact the relevant map resource, which is openstreetmap.org. I was mistaken, OpenStreetMap uses fastly.net to serve its tiles, so fastly.net is necessary, and all is well with the Leaflet module.Remaining tasks
Switch from Geolocation to Geofield and Leaflet.
The text was updated successfully, but these errors were encountered: