Skip to content

✨ Add leaflet shortcode that adds map without storing cookies#2277

Closed
servedsmart wants to merge 7 commits intonunocoracao:mainfrom
servedsmart:leaflet
Closed

✨ Add leaflet shortcode that adds map without storing cookies#2277
servedsmart wants to merge 7 commits intonunocoracao:mainfrom
servedsmart:leaflet

Conversation

@servedsmart
Copy link
Copy Markdown
Contributor

@servedsmart servedsmart commented Jun 24, 2025

This has been tested for functionality and every shortcode parameter has been tested separately.

Purpose

This does not store any cookies/localstorage etc. and therefore should be easy to implement even for EU countries.

As far as I know, using the iframe from OpenStreetMap or UMAP is not compatibly with a lot of security headers and requires storing a cookie. Because of the cookie, it requires Cross-Origin-Embedder-Policy: unsafe-none according to my testing.

This is compatible with the following HTTP security headers (only relevant ones are included):

img-src 'self' blob: data: https://tile.openstreetmap.org
Cross-Origin-Embedder-Policy: credentialless
Cross-Origin-Resource-Policy: same-origin

Example

This is the documentation with an example of how the map would look.

@netlify
Copy link
Copy Markdown

netlify bot commented Jun 24, 2025

Deploy Preview for snazzy-dango-efb2ec ready!

Name Link
🔨 Latest commit c1e4722
🔍 Latest deploy log https://app.netlify.com/projects/snazzy-dango-efb2ec/deploys/685afb040be65f00080d7a6a
😎 Deploy Preview https://deploy-preview-2277--snazzy-dango-efb2ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@servedsmart servedsmart marked this pull request as draft June 24, 2025 19:57
@servedsmart
Copy link
Copy Markdown
Contributor Author

servedsmart commented Jun 24, 2025

There is currently an issue with z-indexes that are being assigned by leaflet not being compatible with the theme layout, therefore this needs some more work and testing.

@servedsmart
Copy link
Copy Markdown
Contributor Author

I will switch this to OpenLayers for myself. I might submit a PR for that later. It isn't as straight forward as this, therefore it might be hard to maintain here.

If someone would want that feature though, I will definetly add a PR here. I have got it working quite well at the moment but my current implementation is still being tested.

@servedsmart servedsmart deleted the leaflet branch June 26, 2025 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant