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

Stamen maps not working #233

Open
giobiondani opened this issue Apr 16, 2024 · 3 comments
Open

Stamen maps not working #233

giobiondani opened this issue Apr 16, 2024 · 3 comments

Comments

@giobiondani
Copy link

I am using BruTile through Mapsui and I noticed that the StamenTerrain KnownTileSource has stopped working - the map is empty.

I wonder if this has something to do with the Stamen maps moving to Stadia and requiring a Stadia API key.

@giobiondani
Copy link
Author

I was able to make it work by replacing the URL formatter in the KnownTileSources with this:

"https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key=" + StadiaAPIKey

@pauldendulk
Copy link
Contributor

You added your personal api key? Perhaps I should request an api key for the demo.

@giobiondani
Copy link
Author

yes, in my app I created this method that is called when I need this map:

        public static HttpTileSource StamenTerrain() {
            return new HttpTileSource(
                new GlobalSphericalMercator(4, 19),
                "https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key=" + StadiaAPIKey,
                null, apiKey: null, name: null,
                persistentCache: null, tileFetcher: null,
                attribution: GetStadiaAttribution(), userAgent: null
            );
        }

the StadiaAPIKey variable refers to my own key, which is configured elsewhere in the app.
This works fine.
I tried to use the "apiKey" parameter for the API key but it wouldn't work that way, that's why I included it in the URL Formatter.

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

2 participants