Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow switching layers #6

Open
eyeseast opened this issue Jan 23, 2022 · 0 comments
Open

Allow switching layers #6

eyeseast opened this issue Jan 23, 2022 · 0 comments

Comments

@eyeseast
Copy link
Owner

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: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant