Tile Providers
geoplotlib supports the use of different tile providers. This means that any OpenStreetMap tile server can be used as a backdrop for our visualization. Some of the popular free tile providers include Stamen Watercolor, Stamen Toner, Stamen Toner Lite, and DarkMatter. Changing the tile provider can be done in two ways:
- Make use of built-in tile providers:
geoplotlib contains a few built-in tile providers with shortcuts. The following code shows you how to use it:
geoplotlib.tiles_provider('darkmatter')
- Provide a custom object to the tiles_provider method:
By providing a custom object to geoplotlib's
tiles_provider()
method, you will not only get access to theurl
parameter from which the map tiles are being loaded but also see theattribution
parameter displayed in the lower-right corner of the visualization. We are also able to set a distinct caching directory for the downloaded tiles. The following code demonstrates how to provide a custom object...