-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
159 changed files
with
32,143 additions
and
15,225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: 142ab798bc511ee3a3193ada5a679351 | ||
config: 13174057a27b971bffec284bf2dd0b38 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file modified
BIN
-381 Bytes
(99%)
latest/_images/user_guide_plugins_timeslider_choropleth_12_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(100%)
latest/_images/user_guide_plugins_timeslider_choropleth_2_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
latest/_sources/user_guide/plugins/overlapping_marker_spiderfier.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# OverlappingMarkerSpiderfier | ||
|
||
The `OverlappingMarkerSpiderfier` is a plugin for Folium that helps manage overlapping markers by "spiderfying" them when clicked, making it easier to select individual markers. | ||
|
||
## Using with Markers | ||
|
||
```{code-cell} ipython3 | ||
import folium | ||
from folium.plugins import OverlappingMarkerSpiderfier | ||
|
||
# Create a map | ||
m = folium.Map(location=[45.05, 3.05], zoom_start=13) | ||
|
||
# Add markers to the map | ||
for i in range(20): | ||
folium.Marker( | ||
location=[45.05 + i * 0.0001, 3.05 + i * 0.0001], | ||
popup=f"Marker {i}" | ||
).add_to(m) | ||
|
||
# Add the OverlappingMarkerSpiderfier plugin | ||
oms = OverlappingMarkerSpiderfier( | ||
keep_spiderfied=True, # Markers remain spiderfied after clicking | ||
nearby_distance=20, # Distance for clustering markers in pixel | ||
circle_spiral_switchover=10, # Threshold for switching between circle and spiral | ||
leg_weight=2.0 # Line thickness for spider legs | ||
) | ||
oms.add_to(m) | ||
|
||
m | ||
``` | ||
|
||
## Using with FeatureGroups | ||
|
||
```{code-cell} ipython3 | ||
import folium | ||
from folium.plugins import OverlappingMarkerSpiderfier | ||
|
||
# Create a map | ||
m = folium.Map(location=[45.05, 3.05], zoom_start=13) | ||
|
||
# Create a FeatureGroup | ||
feature_group = folium.FeatureGroup(name='Feature Group') | ||
|
||
# Add markers to the FeatureGroup | ||
for i in range(10): | ||
folium.Marker( | ||
location=[45.05 + i * 0.0001, 3.05 + i * 0.0001], | ||
popup=f"Feature Group Marker {i}" | ||
).add_to(feature_group) | ||
|
||
# Add the FeatureGroup to the map | ||
feature_group.add_to(m) | ||
|
||
# Initialize OverlappingMarkerSpiderfier | ||
oms = OverlappingMarkerSpiderfier() | ||
oms.add_to(m) | ||
|
||
m | ||
``` | ||
|
||
## Using with FeatureGroupSubGroups | ||
|
||
```{code-cell} ipython3 | ||
import folium | ||
from folium.plugins import OverlappingMarkerSpiderfier, FeatureGroupSubGroup | ||
|
||
# Create a map | ||
m = folium.Map(location=[45.05, 3.05], zoom_start=13) | ||
|
||
# Create a main FeatureGroup | ||
main_group = folium.FeatureGroup(name='Main Group') | ||
|
||
# Create sub-groups | ||
sub_group1 = FeatureGroupSubGroup(main_group, name='Sub Group 1') | ||
sub_group2 = FeatureGroupSubGroup(main_group, name='Sub Group 2') | ||
|
||
# Add markers to the first sub-group | ||
for i in range(10): | ||
folium.Marker( | ||
location=[45.05 + i * 0.0001, 3.05 + i * 0.0001], | ||
popup=f"Sub Group 1 Marker {i}" | ||
).add_to(sub_group1) | ||
|
||
# Add markers to the second sub-group | ||
for i in range(10, 20): | ||
folium.Marker( | ||
location=[45.06 + (i - 10) * 0.0001, 3.06 + (i - 10) * 0.0001], | ||
popup=f"Sub Group 2 Marker {i}" | ||
).add_to(sub_group2) | ||
|
||
# Add the main group to the map | ||
main_group.add_to(m) | ||
|
||
# Add sub-groups to the map | ||
sub_group1.add_to(m) | ||
sub_group2.add_to(m) | ||
|
||
# Initialize OverlappingMarkerSpiderfier | ||
oms = OverlappingMarkerSpiderfier() | ||
oms.add_to(m) | ||
|
||
# Add the LayerControl plugin | ||
folium.LayerControl().add_to(m) | ||
|
||
m | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.