simonw / datasette-leaflet-geojson

Datasette plugin that replaces any GeoJSON column values with a Leaflet map.
17 stars 7 forks source link

add config options for tile_layer and tile_layer_options #19

Closed mfa closed 1 year ago

mfa commented 1 year ago

I wanted to use statiamaps in Datasette but in this plugin the tile_layer is set in the js-file. This change adds TILE_LAYER and TILE_LAYER_OPTIONS the same way as in https://github.com/simonw/datasette-cluster-map.

example usage with stadiamaps in metadata.yml:

---
plugins:
  datasette-leaflet-geojson:
    tile_layer: "https://tiles.stadiamaps.com/tiles/osm_bright/{z}/{x}/{y}{r}.png?api_key=YOUR_API_KEY"
    tile_layer_options:
      attribution: '&copy; <a href="https://stadiamaps.com/">Stadia Maps</a>, &copy; <a href="https://openmaptiles.org/">OpenMapTiles</a> &copy; <a href="https://openstreetmap.org">OpenStreetMap</a> contributors'
      maxZoom: 20
mfa commented 1 year ago

duplicate of #18 about a year prior. sorry for the noise.