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
The `OverlappingMarkerSpiderfier` plugin for Folium is designed to handle overlapping markers on a map. When multiple markers are located at the same or nearby coordinates, they can overlap, making it difficult to interact with individual markers. This plugin "spiderfies" the markers, spreading them out in a spider-like pattern, allowing users to easily click and view each marker.
4
-
5
-
## Features
6
-
7
-
-**Spiderfying**: Automatically spreads out overlapping markers into a spider-like pattern when clicked, making them individually accessible.
8
-
-**Customizable Options**: Offers options to customize the behavior and appearance of the spiderfied markers, such as `keepSpiderfied`, `nearbyDistance`, and `legWeight`.
9
-
-**Popup Integration**: Supports popups for each marker, which can be customized to display additional information.
10
-
-**Layer Control**: Can be added as a layer to the map, allowing users to toggle its visibility.
11
-
12
-
## Usage
13
-
14
-
To use the `OverlappingMarkerSpiderfier`, you need to create a list of `folium.Marker` objects and pass them to the plugin. You can also customize the options to suit your needs.
15
-
16
-
### Example
17
-
18
-
```python
3
+
```{code-cell} ipython3
19
4
import folium
20
5
from folium import plugins
21
6
@@ -25,7 +10,6 @@ m = folium.Map(location=[45.05, 3.05], zoom_start=14)
25
10
# Generate some markers
26
11
markers = [folium.Marker(location=[45.05 + i * 0.0001, 3.05 + i * 0.0001], options={'desc': f'Marker {i}'}) for i in range(10)]
-**keepSpiderfied**: (bool) Whether to keep the markers spiderfied after clicking.
46
-
-**nearbyDistance**: (int) The distance in pixels within which markers are considered overlapping.
47
-
-**legWeight**: (float) The weight of the spider legs connecting the markers.
48
-
49
-
## Installation
50
-
51
-
Ensure you have Folium installed in your Python environment. You can install it using pip:
52
-
53
-
```bash
54
-
pip install folium
55
-
```
56
-
57
-
## Conclusion
58
-
59
-
The `OverlappingMarkerSpiderfier` plugin is a powerful tool for managing overlapping markers on a map, enhancing the user experience by making it easier to interact with individual markers. Customize it to fit your application's needs and improve the clarity of your map visualizations.
0 commit comments