datasette-leaflet-geojson by simonw

53 downloads this week        Star

README source code


PyPI Changelog Tests License

Datasette plugin that replaces any GeoJSON column values with a Leaflet map


Install this plugin in the same environment as Datasette.

$ datasette install datasette-leaflet-geojson


Any columns containing valid GeoJSON strings will have their contents replaced with a Leaflet map when they are displayed in the Datasette interface.


You can try this plugin out at

datasette-leaflet-geojson in action


By default this plugin displays maps for the first ten rows, and shows a "Click to load map" prompt for rows past the first ten.

You can change this limit using the default_maps_to_load plugin configuration setting. Add this to your metadata.json:

    "plugins": {
        "datasette-leaflet-geojson": {
            "default_maps_to_load": 20

Then run Datasette with datasette mydb.db -m metadata.json.