Skip to content

Commit 31340d3

Browse files
committed
fixed docstring and type notation for geocode_zoom
1 parent 5c7d7a0 commit 31340d3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

folium/plugins/geocoder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from folium.elements import JSCSSMixin
55
from folium.utilities import parse_options
66

7+
from typing import Optional
8+
79

810
class Geocoder(JSCSSMixin, MacroElement):
911
"""A simple geocoder for Leaflet that by default uses OSM/Nominatim.
@@ -19,7 +21,7 @@ class Geocoder(JSCSSMixin, MacroElement):
1921
Choose from 'topleft', 'topright', 'bottomleft' or 'bottomright'.
2022
add_marker: bool, default True
2123
If True, adds a marker on the found location.
22-
geocode_zoom: int, default 11
24+
geocode_zoom: int, default 11, optional
2325
Set zoom level used for displaying the geocode result, note that this only has an effect when add_marker is set to False. Set this to None to preserve the current map zoom level.
2426
geocode_provider: str, default 'nominatim'
2527
Defaults to "nominatim", see https://github.com/perliedman/leaflet-control-geocoder/tree/2.4.0/src/geocoders for other built-in providers.
@@ -73,7 +75,7 @@ def __init__(
7375
collapsed: bool = False,
7476
position: str = "topright",
7577
add_marker: bool = True,
76-
geocode_zoom: int | None = 11,
78+
geocode_zoom: Optional[int] = 11,
7779
geocode_provider: str = "nominatim",
7880
geocode_provider_options: dict = {},
7981
**kwargs

0 commit comments

Comments
 (0)