From 4f36c1cc73442ad95874955f070b46b013d46e4e Mon Sep 17 00:00:00 2001 From: nina-mir Date: Tue, 8 Sep 2026 20:42:06 -0700 Subject: [PATCH] Update GeoJSON docs after the MultiPoint tooltip fix Both pages describe GeoJsonTooltip and GeoJsonPopup as having limitations with MultiPoint and other multi-geometries, and point users at on_each_feature as the workaround. #2263 fixed that, so the guidance now sends people to raw JavaScript for something the standard classes handle. Rewords the on_each_feature page around what it is actually for, and replaces the closing note in the popup and tooltip page with a plain pointer to the advanced guide. --- docs/user_guide/geojson/geojson_advanced_on_each_feature.md | 5 ++--- docs/user_guide/geojson/geojson_popup_and_tooltip.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/user_guide/geojson/geojson_advanced_on_each_feature.md b/docs/user_guide/geojson/geojson_advanced_on_each_feature.md index 4854715883..ef9eb2a25b 100644 --- a/docs/user_guide/geojson/geojson_advanced_on_each_feature.md +++ b/docs/user_guide/geojson/geojson_advanced_on_each_feature.md @@ -9,10 +9,9 @@ import folium The `on_each_feature` parameter in `folium.GeoJson` provides powerful customization capabilities by allowing you to execute JavaScript code for each feature in your GeoJSON data. This is particularly useful for: -- Custom tooltip and popup handling for complex geometries like MultiPoint +- Building tooltip or popup content in JavaScript from feature properties - Adding custom event listeners - Implementing advanced styling logic -- Working with geometry types that need special handling ## Understanding on_each_feature @@ -70,7 +69,7 @@ folium.GeoJson( m ``` -The `on_each_feature` parameter provides the flexibility needed to handle complex GeoJSON scenarios that the standard tooltip and popup classes cannot address, particularly for MultiPoint geometries and advanced interactive features. +The `on_each_feature` parameter gives you direct access to each Leaflet layer, which is useful when you need behavior beyond what `GeoJsonTooltip` and `GeoJsonPopup` provide. ## References diff --git a/docs/user_guide/geojson/geojson_popup_and_tooltip.md b/docs/user_guide/geojson/geojson_popup_and_tooltip.md index 282034a906..500f2add53 100644 --- a/docs/user_guide/geojson/geojson_popup_and_tooltip.md +++ b/docs/user_guide/geojson/geojson_popup_and_tooltip.md @@ -139,4 +139,4 @@ m ``` -The standard `GeoJsonPopup` and `GeoJsonTooltip` classes work well with most geometry types, but have limitations with MultiPoint and other complex multigeometries. For these cases, consider using the `on_each_feature` parameter for custom handling. See the [doc](geojson_advanced_on_each_feature.md) for more information. +For advanced cases — custom event listeners, conditional styling, or building tooltip content in JavaScript — see the `on_each_feature` parameter in [the advanced guide](geojson_advanced_on_each_feature.md).