transitland / mobility-explorer

Understand transportation networks around the world using Transitland open data and Valhalla routing engine APIs
https://mobility-explorer.interline.com/
MIT License
39 stars 15 forks source link

Nextzen #520

Closed drewda closed 6 years ago

drewda commented 6 years ago

related to #519

nvkelso commented 6 years ago

The tiles in this version of basemap will stop working at some point... you can either import the old version and override the source to point at Nextzen or import new version.

drewda commented 6 years ago

@nvkelso good to know. How would I override the source for the time being?

nvkelso commented 6 years ago

View source of https://tile.nextzen.org/preview.html#2/33.0/-12.1

You'd import the older versions... but override the mapzen source in Tangram to specify the different URL and api_key. (The other stuff here is probably not necessary.)


        var layer = Tangram.leafletLayer({
            scene: {
                import: [
                    'https://www.nextzen.org/carto/bubble-wrap-style/8/bubble-wrap-style.zip',
                    'https://www.nextzen.org/carto/bubble-wrap-style/8/themes/label-10.zip'
                ],
                sources: {
                    mapzen: {
                        url: 'https://{s}.tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt',
                        url_subdomains: ['a', 'b', 'c', 'd'],
                        url_params: {
                            api_key: 'redacted'
                        },
                        tile_size: 512,
                        max_zoom: 15
                    }
                }
            },
            attribution: '<a href="https://mapzen.com/tangram" target="_blank">Tangram</a> | <a href="http://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a> | <a href="https://mapzen.com/" target="_blank">Mapzen</a>'
        });
 ```