We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 765f1f1 commit fd0267dCopy full SHA for fd0267d
1 file changed
docs/user_guide/geojson/geojson.md
@@ -236,3 +236,24 @@ colormap.add_to(m)
236
237
m
238
```
239
+
240
+### Highlight function
241
242
+The `GeoJson` class provides a `highlight_function` argument, which works similarly
243
+to `style_function`, but applies on mouse events. In the following example
244
+the fill color will change when you hover your mouse over a feature.
245
246
+```{code-cell} ipython3
247
+m = folium.Map([43, -100], zoom_start=4)
248
249
+folium.GeoJson(
250
+ geo_json_data,
251
+ highlight_function=lambda feature: {
252
+ "fillColor": (
253
+ "green" if "e" in feature["properties"]["name"].lower() else "#ffff00"
254
+ ),
255
+ },
256
+).add_to(m)
257
258
+m
259
+```
0 commit comments