MCPcopy Index your code
hub / github.com/python-visualization/folium / test_tile_layer

Function test_tile_layer

tests/test_raster_layers.py:15–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def test_tile_layer():
16 m = folium.Map([48.0, 5.0], zoom_start=6)
17 layer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
18
19 folium.raster_layers.TileLayer(
20 tiles=layer, name="OpenStreetMap", attr="attribution"
21 ).add_to(m)
22
23 folium.raster_layers.TileLayer(
24 tiles=layer, name="OpenStreetMap2", attr="attribution2", overlay=True
25 ).add_to(m)
26
27 folium.LayerControl().add_to(m)
28 m._repr_html_()
29
30 bounds = m.get_bounds()
31 assert bounds == [[None, None], [None, None]], bounds
32
33
34def _is_working_zoom_level(zoom, tiles, session):

Callers

nothing calls this directly

Calls 3

_repr_html_Method · 0.95
add_toMethod · 0.80
get_boundsMethod · 0.80

Tested by

no test coverage detected