Leaflet
Small JavaScript library for interactive maps in the browser, with image tiles, markers and plugins such as marker clustering.
Reviewed by adrian
on
Leaflet draws interactive maps from image tiles and puts markers, popups and layers on top. I use it with the plugin leaflet.markercluster for the world map of my photos.
What matters in practice
- Tiles are plain
<img>elements: a Content Security Policy needs the tile host inimg-src, not inconnect-src. referrerPolicyon the tile layer (since version 1.9) sets the Referrer-Policy for each tile image and overrides the page's policy. Tile services that check the domain need it.
Based on
Used in
- Leaflet and Stadia Maps Behind a Strict CSP Two fixes that made the photo world map work in production: the tile host in img-src and a Referrer-Policy of origin on the tiles.