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: docs/user_guide/plugins/overlapping_marker_spiderfier.md
+84-6Lines changed: 84 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
The `OverlappingMarkerSpiderfier` is a plugin for Folium that helps manage overlapping markers by "spiderfying" them when clicked, making it easier to select individual markers.
4
4
5
+
## Using with Markers
6
+
5
7
```{code-cell} ipython3
6
8
import folium
7
9
from folium.plugins import OverlappingMarkerSpiderfier
@@ -17,13 +19,89 @@ for i in range(20):
17
19
).add_to(m)
18
20
19
21
# Add the OverlappingMarkerSpiderfier plugin
20
-
oms = OverlappingMarkerSpiderfier(options={
21
-
"keepSpiderfied": True, # Markers remain spiderfied after clicking
22
-
"nearbyDistance": 20, # Distance for clustering markers in pixel
23
-
"circleSpiralSwitchover": 10, # Threshold for switching between circle and spiral
24
-
"legWeight": 2.0 # Line thickness for spider legs
25
-
})
22
+
oms = OverlappingMarkerSpiderfier(
23
+
keep_spiderfied=True, # Markers remain spiderfied after clicking
24
+
nearby_distance=20, # Distance for clustering markers in pixel
25
+
circle_spiral_switchover=10, # Threshold for switching between circle and spiral
26
+
leg_weight=2.0 # Line thickness for spider legs
27
+
)
26
28
oms.add_to(m)
27
29
28
30
m
29
31
```
32
+
33
+
## Using with FeatureGroups
34
+
35
+
```{code-cell} ipython3
36
+
import folium
37
+
from folium.plugins import OverlappingMarkerSpiderfier
38
+
39
+
# Create a map
40
+
m = folium.Map(location=[45.05, 3.05], zoom_start=13)
0 commit comments