toga icon indicating copy to clipboard operation
toga copied to clipboard

Custom map tiles

Open StyXman opened this issue 1 year ago • 3 comments

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

StyXman avatar May 06 '24 08:05 StyXman

The maxZoom property will also have to be able to be changed; not all maps have the same (usually 18).

StyXman avatar May 06 '24 08:05 StyXman

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.

freakboy3742 avatar May 07 '24 02:05 freakboy3742

I was thinking in terms of either more specialized maps like OpenSnowMap or the fact I do my own rendering.

StyXman avatar May 07 '24 08:05 StyXman

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.

freakboy3742 avatar May 07 '24 22:05 freakboy3742

TBH, there's already a disparity because OSM and Apple's renderings are already different. But I get your point. I'll close it.

StyXman avatar May 08 '24 14:05 StyXman