File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
docs/source/api_reference Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,27 @@ Example
21
21
22
22
m
23
23
24
+ You can add a callback that will be run when on search found:
25
+
26
+ .. jupyter-execute ::
27
+
28
+ m = Map(center=[47, 2], zoom=5)
29
+
30
+ search = SearchControl(
31
+ position="topleft",
32
+ url='https://cartoradon.irsn.fr/commune.py/communes/search/FR/{s}?',
33
+ zoom=5
34
+ )
35
+ m.add_control(search)
36
+
37
+ def on_found(**kwargs):
38
+ # Print the result of the search (text, location etc)
39
+ print(kwargs)
40
+
41
+ search.on_location_found(on_found)
42
+
43
+ m
44
+
24
45
You can also search features from GeoJSON layers.
25
46
26
47
.. jupyter-execute ::
@@ -77,5 +98,6 @@ Methods
77
98
================ ===================================== ===
78
99
Method Arguments Doc
79
100
================ ===================================== ===
101
+ on_location_found Callable object Adds a callback on location found event.
80
102
on_feature_found Callable object Adds a callback on found event for searching in GeoJSON layer.
81
- ================ ===================================== ===
103
+ ================ ===================================== ===
You can’t perform that action at this time.
0 commit comments