eyeseast / datasette-geojson-map

Render a map for any query with a geometry column
23 stars 1 forks source link

Load CSS in the client, not server #16

Open eyeseast opened 2 years ago

eyeseast commented 2 years ago

This import was probably a bad idea: https://github.com/eyeseast/datasette-geojson-map/blob/main/datasette_geojson_map/__init__.py#L6

That ended up breaking with PR that changed how Leaflet URLs get generated: https://github.com/simonw/datasette-leaflet/pull/9. I could run the plugin hook inside this plugin to generate the right URLs, but that still feels like the wrong way to do it. I could re-run the logic in datasette-leaflet to build the right URL, but I don't want to.

So client-side is probably the best way to ensure the right CSS and JS files are loaded.

eyeseast commented 1 year ago

It's also possible I should just load leaflet independently, rather than try to coordinate with a plugin. If I end up with two versions of Leaflet on the page, maybe I can life with that.