mysociety / local-intelligence-hub

https://www.localintelligencehub.com
Other
6 stars 2 forks source link

Fix Leaflet marker image path discovery (version 2) #588

Closed zarino closed 4 months ago

zarino commented 4 months ago

An alternative to https://github.com/mysociety/local-intelligence-hub/pull/586, where we switch to importing Leaflet as one big module, rather than importing the Map, GeoJSON, and Icon classes individually, which means that Icon.Default.imagePath (or, now, in our case, L.Icon.Default.imagePath) works.

This feels like a better solution than https://github.com/mysociety/local-intelligence-hub/pull/586, which relies on what appears to be a deprecated bit of Leaflet.Icon.Default._getIconUrl.

I don’t know whether importing * from leaflet, rather than importing a handful of classes individually, will increase the size of our compiled CSS – I guess we should check.