maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
929 stars 280 forks source link

Allow to switch from different providers URIs on fly #241

Open rinigus opened 2 years ago

rinigus commented 2 years ago

Judging from Qt platform and from brief look into mbgl::Map, it looks like URI scheme used by the map has to be specified in its constructor. Namely, we have to set TileServerOptions to either support mapbox://, maptiler:// or any other schema. Later, while we can swap schema by giving its URL or JSON, that URI cannot be swapped. Which makes supporting multiple map providers harder than it should be.

So, for now, I am setting the options to for Mapbox and if the user prefers to switch to MapTiler, I use full URL to give the style URL.

It would make sense to add ability to switch between TileServerOptions as we can switch the styles. Don't know whether it is already supported on other platforms, but on Qt it is not and, unless I missed it, it is not available for mbgl::Map either.

louwers commented 1 month ago

I think we should get rid of the built-in providers completely, and let people configure that themselves.

wipfli commented 1 month ago

@louwers do we have an issue to bring something like MapLibre GL JS' addProtocol to Native?

louwers commented 6 days ago

I transferred this proposal from Steve to the Native discussion forum. Before an issue is made we should have an idea about how to implement that and the scope.