How to use different tile providers
See original GitHub issueJust playing around with ipyleaflet
- it’s a neat project! I wasn’t a big fan of the default OpenStreetMap tiles (too busy) so I figured out how to use MapBox tiles.
In case it’s of use for anyone else I’ve documented how to do so below. Since this isn’t a real issue per-se feel free to close…
Using Different Tile Providers
The underlying leaflet.js library is provider agnostic and can be used with almost any tile provider. A preview of freely available tile providers is available at http://leaflet-extras.github.io/leaflet-providers/preview/.
MapBox is a tile provider which has a free plan which requires signing up to get an access token. To use MapBox (as with any other provider) you simply provide the correct url to the TileLayer
constructor - e.g.
url = "https://api.mapbox.com/v4/mapbox.outdoors/{z}/{x}/{y}.png?access_token=%s" % os.environ['MAPBOX_API_TOKEN']
provider = TileLayer(url=url, opacity=1)
m = Map(default_tiles=provider, center=(-27.4698, 153.0251), zoom=5)
m.layout.height = '800px'
m
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to use a different tile provider in openlayer3
You can use any tile map server as your tile source. Just create a XYZ tile source instead of an OSM source with...
Read more >Leaflet - Can I use a different background tile provider ...
It's fine to use different tile sources for different zoom levels, just set the min and max zoom on each layer, and don't...
Read more >MapProvider and Tiles - Unfolding Maps
This option enables switching between different tile providers for the same map. All map settings are persistent, i.e. current transformations, markers, ...
Read more >bokeh.tile_providers — Bokeh 3.0.3 Documentation
Use a tile_providers.Vendors enumeration value, or the string name of one of the known providers. Use xyzservices.TileProvider to pass custom tile providers ......
Read more >Tile Providers | The Data Visualization Workshop
geoplotlib supports the use of different tile providers. This means that any OpenStreetMap tile server can be used as a backdrop for our...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We can now instantiate a tile layer by providing the URL of an existing tile service, or use one of the pre-registered tile layers as shown in the BaseMap example notebook.
Thanks!