Skip to content

Commit

Permalink
fixed docstring and type notation for geocode_zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
prusswan committed Jan 10, 2024
1 parent 5c7d7a0 commit 31340d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions folium/plugins/geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from folium.elements import JSCSSMixin
from folium.utilities import parse_options

from typing import Optional


class Geocoder(JSCSSMixin, MacroElement):
"""A simple geocoder for Leaflet that by default uses OSM/Nominatim.
Expand All @@ -19,7 +21,7 @@ class Geocoder(JSCSSMixin, MacroElement):
Choose from 'topleft', 'topright', 'bottomleft' or 'bottomright'.
add_marker: bool, default True
If True, adds a marker on the found location.
geocode_zoom: int, default 11
geocode_zoom: int, default 11, optional
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.
geocode_provider: str, default 'nominatim'
Defaults to "nominatim", see https://github.com/perliedman/leaflet-control-geocoder/tree/2.4.0/src/geocoders for other built-in providers.
Expand Down Expand Up @@ -73,7 +75,7 @@ def __init__(
collapsed: bool = False,
position: str = "topright",
add_marker: bool = True,
geocode_zoom: int | None = 11,
geocode_zoom: Optional[int] = 11,
geocode_provider: str = "nominatim",
geocode_provider_options: dict = {},
**kwargs
Expand Down

0 comments on commit 31340d3

Please sign in to comment.