-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Custom TileLayer from Stadia maps #2836
Comments
Okay, why do I always find a solution after I've posted a cry for help and after I've banged my head against a wall for several hours? And the tiles load now... But why does it work in js leaflet and python without api keys??? |
Also, is there a way to load retina tiles? the ones where the url has {r}: '/{z}/{x}/{y}{r}.png'? |
Perhaps because of the user-agent or referer. To investigate this you can inspect those in the webpages that use leaflet and set the same user-agent and/or referer in the BruTile tile source.
What is the r here? The resolution of the retina display? If yes, I guess this is the same for all tiles requested from that device. In that case you could detect the r of the device in code somehow and set that value in the url before you assign it to the tile source. |
Mapsui Version
Mapsui 4.1.8 5.0.0-beta.6
Mapsui Platform
Windows WPF .NET 8
Device
Windows
I try to add a TileLayer using tiles from Stadia maps:
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/
The url is one of the next two:
Raster XYZ PNG URL format (up to zoom 20)
https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png
Raster XYZ PNG URL format (up to zoom 20; for OpenLayers, QGIS, MapLibre, and other renderers without retina placeholder support)
https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}@2x.png
I don't know which one works with Mapsui, so I try both. I don't get any map, just white background and no errors.
I've tried replicating how Mapsui is creating OSM map by reading the source code for Mapsui.Tiling.OpenStreetMap.CreateTileLayer(), as I couldn't find a sample that showed this:
The code above doesn't work, what am I doing wrong?
I tried creating a BruTile test project using an example on their page:
but here I get 401 'Unauthorized' error in the 'var tile = await tileSource.GetTileAsync(tileInfo);' line.
So maybe this is what happens behind the scene in Mapsui, but Mapsui eats the exception so I don't get any errors.
And I don't understand why I would be 'Unauthorized' while using an api key. Also I use these tiles in a blazor with leaflet project and it works without any api keys.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: