Skip to content

Commit 1b775f6

Browse files
committed
Added weight option to CircleMarker
1 parent a2b227a commit 1b775f6

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

folium/features.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ class CircleMarker(Marker):
753753
use Circle.
754754
color: str, default 'black'
755755
The color of the marker's edge in a HTML-compatible format.
756+
weight: int, default 2
757+
Stroke weight in pixels
756758
fill_color: str, default 'black'
757759
The fill color of the marker in a HTML-compatible format.
758760
fill_opacity: float, default 0.6
@@ -762,11 +764,13 @@ class CircleMarker(Marker):
762764
763765
"""
764766
def __init__(self, location, radius=500, color='black',
765-
fill_color='black', fill_opacity=0.6, popup=None):
767+
weight=2, fill_color='black', fill_opacity=0.6,
768+
popup=None):
766769
super(CircleMarker, self).__init__(location, popup=popup)
767770
self._name = 'CircleMarker'
768771
self.radius = radius
769772
self.color = color
773+
self.weight = weight
770774
self.fill_color = fill_color
771775
self.fill_opacity = fill_opacity
772776

@@ -777,6 +781,7 @@ def __init__(self, location, radius=500, color='black',
777781
[{{this.location[0]}},{{this.location[1]}}],
778782
{
779783
color: '{{ this.color }}',
784+
weight: '{{ this.weight }}',
780785
fillColor: '{{ this.fill_color }}',
781786
fillOpacity: {{ this.fill_opacity }}
782787
}

tests/test_features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def test_marker_popups():
7272
features.RegularPolygonMarker([45, 0], popup=Popup('0')).add_to(m)
7373
features.CircleMarker([45, 60], popup='60').add_to(m)
7474
features.CircleMarker([45, 120], popup=Popup('120')).add_to(m)
75+
features.CircleMarker([45, 90], popup=Popup('90'), weight=0).add_to(m)
7576
m._repr_html_()
7677

7778
bounds = m.get_bounds()

0 commit comments

Comments
 (0)