foliplus.MapSearch#
- class foliplus.MapSearch(*, position: Literal['topleft', 'topright', 'bottomleft', 'bottomright'] = 'topleft', mode: Literal['coord', 'addr'] = 'coord', zoom: int = 15, locale: str | LocaleConfig | None = None)[source]#
Bases:
BaseControlCoordinate and address search via Nominatim reverse geocoding.
đ Coordinate search: enter a coordinate like longitude, latitude to fly to and place a marker.
đ Address search: enter a keyword and geocode via Nominatim.
Parameters#
- positionstr, default âtopleftâ
One of
"topleft","topright","bottomleft","bottomright".- modeLiteral[âcoordâ, âaddrâ], default âcoordâ
Default search mode on first open.
"coord"for coordinate search,"addr"for address (Nominatim) search.- zoomint, default 15
Zoom level after coordinate search. Typically 1-18.
- localestr or LocaleConfig, optional
Language code (
"en","zh") or aLocaleConfiginstance. Defaults to auto-detection, falling back to English.
Examples#
>>> import folium >>> from foliplus import MapSearch >>> m = folium.Map() >>> MapSearch().add_to(m)
- __init__(*, position: Literal['topleft', 'topright', 'bottomleft', 'bottomright'] = 'topleft', mode: Literal['coord', 'addr'] = 'coord', zoom: int = 15, locale: str | LocaleConfig | None = None)[source]#
Methods
__init__(*[, position, mode, zoom, locale])add_child(child[, name, index])Add a child.
add_children(child[, name, index])Add a child.
add_css_link(name, url)Add or update css resource link.
add_js_link(name, url)Add or update JS resource link.
add_to(parent[, name, index])Add element to a parent.
get_bounds()Computes the bounds of the object and all it's children in the form [[lat_min, lon_min], [lat_max, lon_max]].
get_name()Returns a string representation of the object.
get_root()Returns the root of the elements tree.
render(**kwargs)Renders the HTML representation of the element.
save(outfile[, close_file])Saves an Element into a file.
to_dict([depth, ordered])Returns a dict representation of the object.
to_json([depth])Returns a JSON representation of the object.
Attributes
default_cssdefault_js