toga
toga copied to clipboard
Custom map tiles
What is the problem or limitation you are having?
Current MapViews only support OSM standard raster tiles. This is because the URL template for the tiles is hardcoded:
https://github.com/beeware/toga/blob/main/gtk/src/toga_gtk/widgets/mapview.py#L39
Describe the solution you'd like
Have a MapView attribute to change this.
Describe alternatives you've considered
Theoretically I can change the whole HTML in here:
https://github.com/beeware/toga/blob/main/gtk/src/toga_gtk/widgets/mapview.py#L39
Additional context
No response
The maxZoom property will also have to be able to be changed; not all maps have the same (usually 18).
Thanks for the suggestion.
The complication here is that OSM is only used for some MapView implementations. The macOS and iOS implementations, for example, don't use OSM at all - they use native Apple Maps. So - any configuration option in the public API needs to be framed so that it makes sense in a context that isn't using OSM.
Is there another tile set that you think should be used? I think I read somewhere that OSM was experimenting with vector tiles (which would definitely be preferable), but I didn't know there was a viable tileset available for use.
I was thinking in terms of either more specialized maps like OpenSnowMap or the fact I do my own rendering.
Sure - but as I indicated, macOS and iOS don't support using a different tile set, because they use Apple Maps. Allowing a custom tile set that exposes a different view of the world - such as snow/ski data - means there wouldn't be parity between an iOS and Android app.
TBH, there's already a disparity because OSM and Apple's renderings are already different. But I get your point. I'll close it.