From ba9c8268e5dc39764843daf58a990bc0ac839693 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 4 Oct 2023 13:17:31 -0300 Subject: [PATCH 1/3] remove Stamen --- docs/advanced_guide/custom_panes.md | 6 +- docs/advanced_guide/subplots.md | 3 +- docs/getting_started.md | 4 +- docs/index.rst | 2 +- docs/user_guide/plugins/heatmap.md | 2 +- docs/user_guide/plugins/heatmap_with_time.md | 6 +- docs/user_guide/plugins/mini_map.md | 2 +- docs/user_guide/plugins/tag_filter_button.md | 2 +- .../plugins/timeslider_choropleth.md | 4 +- .../user_guide/raster_layers/image_overlay.md | 4 +- docs/user_guide/raster_layers/tiles.md | 12 - docs/user_guide/ui_elements/icons.md | 2 +- docs/user_guide/ui_elements/layer_control.md | 2 +- docs/user_guide/vector_layers/polyline.md | 2 +- examples/HeatMapWithTime.ipynb | 412 +++++++++++++++++- folium/folium.py | 1 - folium/plugins/minimap.py | 2 +- folium/raster_layers.py | 1 - folium/templates/tiles/stamenterrain/attr.txt | 1 - .../templates/tiles/stamenterrain/tiles.txt | 1 - folium/templates/tiles/stamentoner/attr.txt | 1 - folium/templates/tiles/stamentoner/tiles.txt | 1 - .../tiles/stamentonerbackground/attr.txt | 1 - .../tiles/stamentonerbackground/tiles.txt | 1 - .../tiles/stamentonerlabels/attr.txt | 1 - .../tiles/stamentonerlabels/tiles.txt | 1 - .../templates/tiles/stamenwatercolor/attr.txt | 1 - .../tiles/stamenwatercolor/tiles.txt | 1 - tests/plugins/test_heat_map.py | 2 +- tests/plugins/test_heat_map_withtime.py | 2 +- tests/plugins/test_minimap.py | 4 +- tests/plugins/test_tag_filter_button.py | 2 +- tests/plugins/test_time_slider_choropleth.py | 2 +- tests/test_folium.py | 2 - tests/test_raster_layers.py | 12 +- 35 files changed, 439 insertions(+), 66 deletions(-) delete mode 100644 folium/templates/tiles/stamenterrain/attr.txt delete mode 100644 folium/templates/tiles/stamenterrain/tiles.txt delete mode 100644 folium/templates/tiles/stamentoner/attr.txt delete mode 100644 folium/templates/tiles/stamentoner/tiles.txt delete mode 100644 folium/templates/tiles/stamentonerbackground/attr.txt delete mode 100644 folium/templates/tiles/stamentonerbackground/tiles.txt delete mode 100644 folium/templates/tiles/stamentonerlabels/attr.txt delete mode 100644 folium/templates/tiles/stamentonerlabels/tiles.txt delete mode 100644 folium/templates/tiles/stamenwatercolor/attr.txt delete mode 100644 folium/templates/tiles/stamenwatercolor/tiles.txt diff --git a/docs/advanced_guide/custom_panes.md b/docs/advanced_guide/custom_panes.md index 39066f548..ce3d75697 100644 --- a/docs/advanced_guide/custom_panes.md +++ b/docs/advanced_guide/custom_panes.md @@ -30,7 +30,7 @@ We'll make an example to show how the GeoJson we add hides any labels underneath. ```{code-cell} ipython3 -m = folium.Map([43, -100], zoom_start=4, tiles="stamentoner") +m = folium.Map([43, -100], zoom_start=4) folium.GeoJson(geo_json_data, style_function=style_function).add_to(m) @@ -43,14 +43,14 @@ Now we'll create a custom pane and add a tile layer that contains only labels. The labels will show on top off the geojson. ```{code-cell} ipython3 -m = folium.Map([43, -100], zoom_start=4, tiles="stamentonerbackground") +m = folium.Map([43, -100], zoom_start=4) folium.GeoJson(geo_json_data, style_function=style_function).add_to(m) folium.map.CustomPane("labels").add_to(m) # Final layer associated to custom pane via the appropriate kwarg -folium.TileLayer("stamentonerlabels", pane="labels").add_to(m) +folium.TileLayer(pane="labels").add_to(m) m ``` diff --git a/docs/advanced_guide/subplots.md b/docs/advanced_guide/subplots.md index 75b9f283c..088976e12 100644 --- a/docs/advanced_guide/subplots.md +++ b/docs/advanced_guide/subplots.md @@ -20,7 +20,7 @@ subplot1 = fig.add_subplot(1, 2, 1) subplot2 = fig.add_subplot(1, 2, 2) subplot1.add_child( - folium.Map([0, 0], tiles="stamenwatercolor", zoom_start=1) + folium.Map([0, 0], zoom_start=1) ) subplot2.add_child( folium.Map([46, 3], tiles="OpenStreetMap", zoom_start=5) @@ -54,7 +54,6 @@ f = branca.element.Figure() # Create two maps. m = folium.Map( location=[0, 0], - tiles="stamenwatercolor", zoom_start=1, position="absolute", left="0%", diff --git a/docs/getting_started.md b/docs/getting_started.md index 43f936aab..01bf0059b 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -58,7 +58,7 @@ m.save("index.html") Choosing a tileset ------------------ -The default tiles are set to `OpenStreetMap`, but a selection of tilesets from Stamen and CartoDB are also built in. +The default tiles are set to `OpenStreetMap`, but a selection of tilesets also built in. ```{code-cell} ipython3 folium.Map((45.5236, -122.6750), tiles="cartodb positron") @@ -81,7 +81,7 @@ There are various marker types, here we start with a simple `Marker`. You can ad tooltip. You can also pick colors and icons. ```{code-cell} ipython3 -m = folium.Map([45.35, -121.6972], zoom_start=12, tiles="Stamen Terrain") +m = folium.Map([45.35, -121.6972], zoom_start=12) folium.Marker( location=[45.3288, -121.6625], diff --git a/docs/index.rst b/docs/index.rst index 68f59e496..c3f8aa7d5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,7 +22,7 @@ It enables both the binding of data to a map for choropleth visualizations as well as passing rich vector/raster/HTML visualizations as markers on the map. The library has a number of built-in tilesets from OpenStreetMap, -Mapbox, and Stamen, and supports custom tilesets. +Mapbox, etc, and supports custom tilesets. Folium supports both Image, Video, GeoJSON and TopoJSON overlays and has a number of vector layers built-in. diff --git a/docs/user_guide/plugins/heatmap.md b/docs/user_guide/plugins/heatmap.md index 6bd3fc7ab..b2898114d 100644 --- a/docs/user_guide/plugins/heatmap.md +++ b/docs/user_guide/plugins/heatmap.md @@ -12,7 +12,7 @@ data = ( import folium from folium.plugins import HeatMap -m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) +m = folium.Map([48.0, 5.0], zoom_start=6) HeatMap(data).add_to(m) diff --git a/docs/user_guide/plugins/heatmap_with_time.md b/docs/user_guide/plugins/heatmap_with_time.md index 3f3cb2f55..13fe51954 100644 --- a/docs/user_guide/plugins/heatmap_with_time.md +++ b/docs/user_guide/plugins/heatmap_with_time.md @@ -44,7 +44,7 @@ for time_entry in data: ``` ```{code-cell} ipython3 -m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) +m = folium.Map([48.0, 5.0], zoom_start=6) hm = folium.plugins.HeatMapWithTime(data) @@ -55,7 +55,7 @@ m ### Options -Now we show that the time index can be specified, allowing a more meaningful representation of what the time steps mean. We also enable the 'auto_play' option and change the maximum opacity. See the docmentation for a full list of options that can be used. +Now we show that the time index can be specified, allowing a more meaningful representation of what the time steps mean. We also enable the 'auto_play' option and change the maximum opacity. See the documentation for a full list of options that can be used. ```{code-cell} ipython3 from datetime import datetime, timedelta @@ -66,7 +66,7 @@ time_index = [ ``` ```{code-cell} ipython3 -m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) +m = folium.Map([48.0, 5.0], zoom_start=6) hm = folium.plugins.HeatMapWithTime(data, index=time_index, auto_play=True, max_opacity=0.3) diff --git a/docs/user_guide/plugins/mini_map.md b/docs/user_guide/plugins/mini_map.md index 068591900..0e426b8f8 100644 --- a/docs/user_guide/plugins/mini_map.md +++ b/docs/user_guide/plugins/mini_map.md @@ -23,7 +23,7 @@ m ```{code-cell} ipython3 m = folium.Map(location=(30, 20), zoom_start=4) -MiniMap(tile_layer="Stamen Toner").add_to(m) +MiniMap().add_to(m) m ``` diff --git a/docs/user_guide/plugins/tag_filter_button.md b/docs/user_guide/plugins/tag_filter_button.md index b3466f255..f013ddb33 100644 --- a/docs/user_guide/plugins/tag_filter_button.md +++ b/docs/user_guide/plugins/tag_filter_button.md @@ -25,7 +25,7 @@ Then, create the `TagFilterButton` object and let it know which tags you want to from folium.plugins import TagFilterButton # Create map and add the data with additional parameter tags as the segmentation -m = folium.Map([48., 5.], tiles='stamentoner', zoom_start=7) +m = folium.Map([48., 5.], zoom_start=7) for i, latlng in enumerate(data): category = category_column[i] folium.Marker( diff --git a/docs/user_guide/plugins/timeslider_choropleth.md b/docs/user_guide/plugins/timeslider_choropleth.md index 8b9c942f4..191c0d0c2 100644 --- a/docs/user_guide/plugins/timeslider_choropleth.md +++ b/docs/user_guide/plugins/timeslider_choropleth.md @@ -155,7 +155,7 @@ import folium from folium.plugins import TimeSliderChoropleth -m = folium.Map([0, 0], tiles="Stamen Toner", zoom_start=2) +m = folium.Map([0, 0], zoom_start=2) TimeSliderChoropleth( gdf.to_json(), @@ -170,7 +170,7 @@ m By default the timeslider starts at the beginning. You can also select another timestamp to begin with using the `init_timestamp` parameter. Note that it expects an index to the list of timestamps. In this example we use `-1` to select the last timestamp. ```{code-cell} ipython3 -m = folium.Map([0, 0], tiles="Stamen Toner", zoom_start=2) +m = folium.Map([0, 0], zoom_start=2) TimeSliderChoropleth( gdf.to_json(), diff --git a/docs/user_guide/raster_layers/image_overlay.md b/docs/user_guide/raster_layers/image_overlay.md index 9e469c6dd..5931a435a 100644 --- a/docs/user_guide/raster_layers/image_overlay.md +++ b/docs/user_guide/raster_layers/image_overlay.md @@ -11,7 +11,7 @@ If you have a static image file on your disk, you can simply draw it on the map. import os import folium -m = folium.Map([37, 0], zoom_start=1, tiles="stamentoner") +m = folium.Map([37, 0], zoom_start=1) merc = os.path.join("data", "Mercator_projection_SW.png") @@ -46,7 +46,7 @@ A few remarks: You can also provide simply URL. In this case, the image will not be embedded in folium's output. ```{code-cell} ipython3 -m = folium.Map([37, 0], zoom_start=1, tiles="stamentoner") +m = folium.Map([37, 0], zoom_start=1) folium.raster_layers.ImageOverlay( image="https://upload.wikimedia.org/wikipedia/commons/f/f4/Mercator_projection_SW.jpg", diff --git a/docs/user_guide/raster_layers/tiles.md b/docs/user_guide/raster_layers/tiles.md index bb65c8957..cf7998590 100644 --- a/docs/user_guide/raster_layers/tiles.md +++ b/docs/user_guide/raster_layers/tiles.md @@ -15,18 +15,6 @@ zoom_start = 8 folium.Map(location=[lat, lon], tiles="OpenStreetMap", zoom_start=zoom_start) ``` -```{code-cell} ipython3 -folium.Map(location=[lat, lon], tiles="Stamen Terrain", zoom_start=zoom_start) -``` - -```{code-cell} ipython3 -folium.Map(location=[lat, lon], tiles="Stamen Toner", zoom_start=zoom_start) -``` - -```{code-cell} ipython3 -folium.Map(location=[lat, lon], tiles="Stamen Watercolor", zoom_start=zoom_start) -``` - ```{code-cell} ipython3 folium.Map(location=[lat, lon], tiles="Cartodb Positron", zoom_start=zoom_start) ``` diff --git a/docs/user_guide/ui_elements/icons.md b/docs/user_guide/ui_elements/icons.md index 0d1f1aa57..f5024772c 100644 --- a/docs/user_guide/ui_elements/icons.md +++ b/docs/user_guide/ui_elements/icons.md @@ -32,7 +32,7 @@ m ## Custom icon ```{code-cell} ipython3 -m = folium.Map(location=[45.3288, -121.6625], zoom_start=12, tiles="Stamen Terrain") +m = folium.Map(location=[45.3288, -121.6625], zoom_start=12) url = "https://leafletjs.com/examples/custom-icons/{}".format icon_image = url("leaf-red.png") diff --git a/docs/user_guide/ui_elements/layer_control.md b/docs/user_guide/ui_elements/layer_control.md index 2f495ee86..d2591ecd7 100644 --- a/docs/user_guide/ui_elements/layer_control.md +++ b/docs/user_guide/ui_elements/layer_control.md @@ -13,7 +13,7 @@ Add a control to the map to show or hide layers. m = folium.Map(tiles=None) folium.TileLayer("OpenStreetMap").add_to(m) -folium.TileLayer("stamentoner", show=False).add_to(m) +folium.TileLayer(show=False).add_to(m) folium.LayerControl().add_to(m) diff --git a/docs/user_guide/vector_layers/polyline.md b/docs/user_guide/vector_layers/polyline.md index 1003e71a8..e3c1aada1 100644 --- a/docs/user_guide/vector_layers/polyline.md +++ b/docs/user_guide/vector_layers/polyline.md @@ -115,7 +115,7 @@ lat = +38.89399 lon = -77.03659 zoom_start = 17 -m = folium.Map(location=[lat, lon], tiles="stamen toner", zoom_start=zoom_start) +m = folium.Map(location=[lat, lon], zoom_start=zoom_start) kw = {"color": "red", "fill": True, "radius": 20} diff --git a/examples/HeatMapWithTime.ipynb b/examples/HeatMapWithTime.ipynb index 071094d77..743385ec9 100644 --- a/examples/HeatMapWithTime.ipynb +++ b/examples/HeatMapWithTime.ipynb @@ -70,10 +70,209 @@ { "data": { "text/html": [ - "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ - "" + "" ] }, "execution_count": 3, @@ -82,7 +281,7 @@ } ], "source": [ - "m = folium.Map([48.0, 5.0], tiles=\"stamentoner\", zoom_start=6)\n", + "m = folium.Map([48.0, 5.0], zoom_start=6)\n", "\n", "hm = plugins.HeatMapWithTime(data)\n", "\n", @@ -119,10 +318,209 @@ { "data": { "text/html": [ - "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" ], "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -131,7 +529,7 @@ } ], "source": [ - "m = folium.Map([48.0, 5.0], tiles=\"stamentoner\", zoom_start=6)\n", + "m = folium.Map([48.0, 5.0], zoom_start=6)\n", "\n", "hm = plugins.HeatMapWithTime(data, index=time_index, auto_play=True, max_opacity=0.3)\n", "\n", @@ -158,7 +556,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/folium/folium.py b/folium/folium.py index a9e396613..29656a832 100644 --- a/folium/folium.py +++ b/folium/folium.py @@ -91,7 +91,6 @@ class Map(JSCSSMixin, MacroElement): - "OpenStreetMap" - "Mapbox Bright" (Limited levels of zoom for free tiles) - "Mapbox Control Room" (Limited levels of zoom for free tiles) - - "Stamen" (Terrain, Toner, and Watercolor) - "Cloudmade" (Must pass API key) - "Mapbox" (Must pass API key) - "CartoDB" (positron and dark_matter) diff --git a/folium/plugins/minimap.py b/folium/plugins/minimap.py index 161f2a314..999cabd25 100644 --- a/folium/plugins/minimap.py +++ b/folium/plugins/minimap.py @@ -56,7 +56,7 @@ class MiniMap(JSCSSMixin, MacroElement): Examples -------- - >>> MiniMap(tile_layer="Stamen WaterColor", position="bottomleft") + >>> MiniMap(position="bottomleft") """ _template = Template( diff --git a/folium/raster_layers.py b/folium/raster_layers.py index 411b671f4..6ae7c06c9 100644 --- a/folium/raster_layers.py +++ b/folium/raster_layers.py @@ -32,7 +32,6 @@ class TileLayer(Layer): tiles: str or :class:`xyzservices.TileProvider`, default 'OpenStreetMap' Map tileset to use. Can choose from this list of built-in tiles: - "OpenStreetMap" - - "Stamen Terrain", "Stamen Toner", "Stamen Watercolor" - "CartoDB positron", "CartoDB dark_matter" You can pass a custom tileset to Folium by passing a diff --git a/folium/templates/tiles/stamenterrain/attr.txt b/folium/templates/tiles/stamenterrain/attr.txt deleted file mode 100644 index 54e10b2a9..000000000 --- a/folium/templates/tiles/stamenterrain/attr.txt +++ /dev/null @@ -1 +0,0 @@ -Map tiles by Stamen Design, under CC BY 3.0. Data by © OpenStreetMap, under CC BY SA. diff --git a/folium/templates/tiles/stamenterrain/tiles.txt b/folium/templates/tiles/stamenterrain/tiles.txt deleted file mode 100644 index 159975dd5..000000000 --- a/folium/templates/tiles/stamenterrain/tiles.txt +++ /dev/null @@ -1 +0,0 @@ -https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg diff --git a/folium/templates/tiles/stamentoner/attr.txt b/folium/templates/tiles/stamentoner/attr.txt deleted file mode 100644 index 2886f80c1..000000000 --- a/folium/templates/tiles/stamentoner/attr.txt +++ /dev/null @@ -1 +0,0 @@ -Map tiles by Stamen Design, under CC BY 3.0. Data by © OpenStreetMap, under ODbL. diff --git a/folium/templates/tiles/stamentoner/tiles.txt b/folium/templates/tiles/stamentoner/tiles.txt deleted file mode 100644 index 04c560f3c..000000000 --- a/folium/templates/tiles/stamentoner/tiles.txt +++ /dev/null @@ -1 +0,0 @@ -https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png diff --git a/folium/templates/tiles/stamentonerbackground/attr.txt b/folium/templates/tiles/stamentonerbackground/attr.txt deleted file mode 100644 index fd910dbc4..000000000 --- a/folium/templates/tiles/stamentonerbackground/attr.txt +++ /dev/null @@ -1 +0,0 @@ -Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL. diff --git a/folium/templates/tiles/stamentonerbackground/tiles.txt b/folium/templates/tiles/stamentonerbackground/tiles.txt deleted file mode 100644 index 42291d599..000000000 --- a/folium/templates/tiles/stamentonerbackground/tiles.txt +++ /dev/null @@ -1 +0,0 @@ -https://stamen-tiles-{s}.a.ssl.fastly.net/toner-background/{z}/{x}/{y}{r}.png diff --git a/folium/templates/tiles/stamentonerlabels/attr.txt b/folium/templates/tiles/stamentonerlabels/attr.txt deleted file mode 100644 index fd910dbc4..000000000 --- a/folium/templates/tiles/stamentonerlabels/attr.txt +++ /dev/null @@ -1 +0,0 @@ -Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL. diff --git a/folium/templates/tiles/stamentonerlabels/tiles.txt b/folium/templates/tiles/stamentonerlabels/tiles.txt deleted file mode 100644 index cbbd5ff95..000000000 --- a/folium/templates/tiles/stamentonerlabels/tiles.txt +++ /dev/null @@ -1 +0,0 @@ -https://stamen-tiles-{s}.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}{r}.png diff --git a/folium/templates/tiles/stamenwatercolor/attr.txt b/folium/templates/tiles/stamenwatercolor/attr.txt deleted file mode 100644 index 54e10b2a9..000000000 --- a/folium/templates/tiles/stamenwatercolor/attr.txt +++ /dev/null @@ -1 +0,0 @@ -Map tiles by Stamen Design, under CC BY 3.0. Data by © OpenStreetMap, under CC BY SA. diff --git a/folium/templates/tiles/stamenwatercolor/tiles.txt b/folium/templates/tiles/stamenwatercolor/tiles.txt deleted file mode 100644 index ba44de66d..000000000 --- a/folium/templates/tiles/stamenwatercolor/tiles.txt +++ /dev/null @@ -1 +0,0 @@ -https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg diff --git a/tests/plugins/test_heat_map.py b/tests/plugins/test_heat_map.py index 5be0b903c..736175366 100644 --- a/tests/plugins/test_heat_map.py +++ b/tests/plugins/test_heat_map.py @@ -15,7 +15,7 @@ def test_heat_map(): np.random.seed(3141592) data = np.random.normal(size=(100, 2)) * np.array([[1, 1]]) + np.array([[48, 5]]) - m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) + m = folium.Map([48.0, 5.0], zoom_start=6) hm = HeatMap(data) m.add_child(hm) m._repr_html_() diff --git a/tests/plugins/test_heat_map_withtime.py b/tests/plugins/test_heat_map_withtime.py index 6d6e7bddd..7713ec4ea 100644 --- a/tests/plugins/test_heat_map_withtime.py +++ b/tests/plugins/test_heat_map_withtime.py @@ -18,7 +18,7 @@ def test_heat_map_with_time(): ) move_data = np.random.normal(size=(100, 2)) * 0.01 data = [(initial_data + move_data * i).tolist() for i in range(100)] - m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) + m = folium.Map([48.0, 5.0], zoom_start=6) hm = plugins.HeatMapWithTime(data).add_to(m) out = normalize(m._parent.render()) diff --git a/tests/plugins/test_minimap.py b/tests/plugins/test_minimap.py index cdc3fa064..5646648c0 100644 --- a/tests/plugins/test_minimap.py +++ b/tests/plugins/test_minimap.py @@ -20,9 +20,9 @@ def test_minimap(): assert "new L.Control.MiniMap" in out m = folium.Map(location=(30, 20), zoom_start=4) - minimap = plugins.MiniMap(tile_layer="Stamen Toner") + minimap = plugins.MiniMap() minimap.add_to(m) out = normalize(m._parent.render()) # verify that Stamen Toner tiles are being used - assert "https://stamen-tiles" in out + assert r"https://{s}.tile.openstreetmap.org" in out diff --git a/tests/plugins/test_tag_filter_button.py b/tests/plugins/test_tag_filter_button.py index 8daadcf7a..434fb6d64 100644 --- a/tests/plugins/test_tag_filter_button.py +++ b/tests/plugins/test_tag_filter_button.py @@ -25,7 +25,7 @@ def test_tag_filter_button(): categories = [f"category{i + 1}" for i in range(n)] category_column = [random.choice(categories) for i in range(len(initial_data))] # Create map and add the data with additional parameter tags as the segmentation - m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) + m = folium.Map([48.0, 5.0], zoom_start=6) for i, latlng in enumerate(initial_data): category = category_column[i] folium.Marker(tuple(latlng), tags=[category]).add_to(m) diff --git a/tests/plugins/test_time_slider_choropleth.py b/tests/plugins/test_time_slider_choropleth.py index ef428c2d3..4d21db417 100644 --- a/tests/plugins/test_time_slider_choropleth.py +++ b/tests/plugins/test_time_slider_choropleth.py @@ -68,7 +68,7 @@ def norm(col): for country, data in styledata.items() } - m = folium.Map((0, 0), tiles="Stamen Watercolor", zoom_start=2) + m = folium.Map((0, 0), zoom_start=2) time_slider_choropleth = TimeSliderChoropleth(gdf.to_json(), styledict) time_slider_choropleth.add_to(m) diff --git a/tests/test_folium.py b/tests/test_folium.py index 85132e586..26443e03b 100644 --- a/tests/test_folium.py +++ b/tests/test_folium.py @@ -110,8 +110,6 @@ def test_builtin_tile(self): default_tiles = [ "OpenStreetMap", - "Stamen Terrain", - "Stamen Toner", "CartoDB positron", "CartoDB dark_matter", ] diff --git a/tests/test_raster_layers.py b/tests/test_raster_layers.py index d369fa911..c4cefec09 100644 --- a/tests/test_raster_layers.py +++ b/tests/test_raster_layers.py @@ -11,7 +11,7 @@ def test_tile_layer(): - m = folium.Map([48.0, 5.0], tiles="stamentoner", zoom_start=6) + m = folium.Map([48.0, 5.0], zoom_start=6) layer = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" folium.raster_layers.TileLayer( @@ -114,22 +114,24 @@ def test_image_overlay(): def test_xyzservices(): - m = folium.Map([48.0, 5.0], tiles=xyzservices.providers.Stamen.Toner, zoom_start=6) + m = folium.Map( + [48.0, 5.0], tiles=xyzservices.providers.CartoDB.DarkMatter, zoom_start=6 + ) folium.raster_layers.TileLayer( - tiles=xyzservices.providers.Stamen.Terrain, + tiles=xyzservices.providers.CartoDB.Positron, ).add_to(m) folium.LayerControl().add_to(m) out = m._parent.render() assert ( - xyzservices.providers.Stamen.Toner.build_url( + xyzservices.providers.CartoDB.DarkMatter.build_url( fill_subdomain=False, scale_factor="{r}" ) in out ) assert ( - xyzservices.providers.Stamen.Terrain.build_url( + xyzservices.providers.CartoDB.Positron.build_url( fill_subdomain=False, scale_factor="{r}" ) in out From 7bccc203be3c2835a39aeffa01f4838ed54d0a6c Mon Sep 17 00:00:00 2001 From: Conengmo <33519926+Conengmo@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:48:00 +0200 Subject: [PATCH 2/3] address comments on docs --- docs/advanced_guide/custom_panes.md | 4 ++-- docs/getting_started.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/advanced_guide/custom_panes.md b/docs/advanced_guide/custom_panes.md index ce3d75697..cece381d0 100644 --- a/docs/advanced_guide/custom_panes.md +++ b/docs/advanced_guide/custom_panes.md @@ -43,14 +43,14 @@ Now we'll create a custom pane and add a tile layer that contains only labels. The labels will show on top off the geojson. ```{code-cell} ipython3 -m = folium.Map([43, -100], zoom_start=4) +m = folium.Map([43, -100], zoom_start=4, tiles="cartodbpositronnolabels") folium.GeoJson(geo_json_data, style_function=style_function).add_to(m) folium.map.CustomPane("labels").add_to(m) # Final layer associated to custom pane via the appropriate kwarg -folium.TileLayer(pane="labels").add_to(m) +folium.TileLayer("cartodbpositrononlylabels", pane="labels").add_to(m) m ``` diff --git a/docs/getting_started.md b/docs/getting_started.md index 01bf0059b..d5ecbcb9c 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -58,7 +58,7 @@ m.save("index.html") Choosing a tileset ------------------ -The default tiles are set to `OpenStreetMap`, but a selection of tilesets also built in. +The default tiles are set to `OpenStreetMap`, but a selection of tilesets are also built in. ```{code-cell} ipython3 folium.Map((45.5236, -122.6750), tiles="cartodb positron") From 4b7495138f84c8e47d56cb69ad6d7aa2dcf522b8 Mon Sep 17 00:00:00 2001 From: Conengmo <33519926+Conengmo@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:51:05 +0200 Subject: [PATCH 3/3] Update test_minimap.py --- tests/plugins/test_minimap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/plugins/test_minimap.py b/tests/plugins/test_minimap.py index 5646648c0..5919c9cde 100644 --- a/tests/plugins/test_minimap.py +++ b/tests/plugins/test_minimap.py @@ -19,10 +19,10 @@ def test_minimap(): # Verify that a new minimap is getting created. assert "new L.Control.MiniMap" in out - m = folium.Map(location=(30, 20), zoom_start=4) + m = folium.Map(tiles=None, location=(30, 20), zoom_start=4) minimap = plugins.MiniMap() minimap.add_to(m) out = normalize(m._parent.render()) - # verify that Stamen Toner tiles are being used + # verify that tiles are being used assert r"https://{s}.tile.openstreetmap.org" in out