Skip to content

Add class definition #569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,19 @@ class Circle(Marker):
The fill opacity of the marker, between 0. and 1.
popup: string or folium.Popup, default None
Input text or visualization for object.
class_name: string, default is an empty string
Class name to associate with the circle, known as ClassName in the leaflet spec

"""
def __init__(self, location, radius=500, color='black',
fill_color='black', fill_opacity=0.6, popup=None):
fill_color='black', fill_opacity=0.6, popup=None, class_name=''):
super(Circle, self).__init__(location, popup=popup)
self._name = 'Circle'
self.radius = radius
self.color = color
self.fill_color = fill_color
self.fill_opacity = fill_opacity
self.fill_opacity = fill_opacity
self.class_name = class_name

self._template = Template(u"""
{% macro script(this, kwargs) %}
Expand All @@ -730,6 +733,7 @@ def __init__(self, location, radius=500, color='black',
[{{this.location[0]}},{{this.location[1]}}],
{{ this.radius }},
{
className: '{{this.class_name}}',
color: '{{ this.color }}',
fillColor: '{{ this.fill_color }}',
fillOpacity: {{ this.fill_opacity }}
Expand Down