You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: folium/plugins/geocoder.py
+119-2Lines changed: 119 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,16 @@ class Geocoder(JSCSSMixin, MacroElement):
19
19
Choose from 'topleft', 'topright', 'bottomleft' or 'bottomright'.
20
20
add_marker: bool, default True
21
21
If True, adds a marker on the found location.
22
+
geocodeProvider: str, default 'nominatim'
23
+
see https://github.com/perliedman/leaflet-control-geocoder/tree/2.4.0/src/geocoders for other built-in providers
24
+
geocodeProviderOptions: dict, default None
25
+
For use with specific providers that may require api keys or other parameters
26
+
serviceUrl: str, default None
27
+
For use with user-defined geocode provider. If used, geocodeFunction must also be specified, geocodeProvider param will be ignored.
28
+
geocodeFunction: str, default None
29
+
geocode function of user-defined geocode provider. see https://github.com/perliedman/leaflet-control-geocoder/blob/1.13.0/src/geocoders/nominatim.js for a reference implementation
30
+
resultsHandlerFunction: str, default None
31
+
For use with user-defined geocode provider, to format geocoding responses into the format expected by leaflet-control-geocoder. Each result should have 'name','center' (L.latLng),'bbox' (L.latLngBounds) properties. see https://github.com/perliedman/leaflet-control-geocoder/blob/1.13.0/src/geocoders/photon.js (_decodeFeatures) for a reference implementation
22
32
23
33
For all options see https://github.com/perliedman/leaflet-control-geocoder
24
34
@@ -27,8 +37,103 @@ class Geocoder(JSCSSMixin, MacroElement):
27
37
_template=Template(
28
38
"""
29
39
{% macro script(this, kwargs) %}
40
+
41
+
var geocoderOpts_{{ this.get_name() }} = {{ this.options|tojson }};
42
+
if ('geocodeFunction' in geocoderOpts_{{ this.get_name() }}) {
0 commit comments