datasette-geojson-map
datasette-geojson-map copied to clipboard
Allow switching layers
The current configuration setup assumes one tile layer:
datasette-geojson-map:
tile_layer: https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.{ext}
tile_layer_options:
attribution: >-
Map tiles by <a href="http://stamen.com">Stamen Design</a>,
under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.
Data by <a href="http://openstreetmap.org">OpenStreetMap</a>,
under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
subdomains: abcd
minZoom: 1
maxZoom: 16
ext: jpg
What if I configured more than one layer, as an array. Then I could add a layer switch control.
datasette-geojson-map:
tile_layers:
name: Stamen Terrain
url: https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.{ext}
options:
attribution: >-
Map tiles by <a href="http://stamen.com">Stamen Design</a>,
under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>.
Data by <a href="http://openstreetmap.org">OpenStreetMap</a>,
under <a href="http://www.openstreetmap.org/copyright">ODbL</a>.
subdomains: abcd
minZoom: 1
maxZoom: 16
ext: jpg
name: OSM
url: https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
options:
attribution: © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors