awmross
awmross

Reputation: 3839

Allow user to choose from different Tile Sources in osmdroid

I want to add a map chooser to my osmdroid app, so the user can choose different map types at runtime (e.g. mapnik, Bing maps, opencyclemap etc). Similar to the way you can do that in other map applications e.g. Google maps, leaflet etc.

Does osmdroid provide a UI out-of-the-box to do this? Or do I have to build the UI myself?

I have searched online and couldn't find any mention of anyone wanting to do this. It seems like it would be a very common use case.

For example, leaflet (the browser version) allows you to pass in an array of tilesources, and it automatically adds a dropdown to the map that lets you choose which map to display.

As far as I can tell, MapView only has a setTileSource(ITileSource) method.

Just to be clear, I don't want to display two map styles at once. I want the user to be able to choose from a list of tile sources.

Upvotes: 0

Views: 231

Answers (1)

Bobabooy114
Bobabooy114

Reputation: 105

You are correct about setting tile sources, but you do have to build your own UI for it, if you want to allow the user to change it at runtime

Upvotes: 2

Related Questions