Skip to content

Fix icon_create_function in MarkerCluster #954

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

Merged
merged 3 commits into from
Sep 4, 2018

Conversation

Conengmo
Copy link
Member

@Conengmo Conengmo commented Sep 4, 2018

Closes #945.

  • Insert the custom Javascript function icon_create_function directly to the template.
  • Assert it has the correct type (str).
  • Strip whitespaces around the Jinja2 blocks.

@@ -51,6 +51,10 @@ class MarkerCluster(Layer):
_template = Template(u"""
{% macro script(this, kwargs) %}
var {{this.get_name()}} = L.markerClusterGroup({{ this.options }});
{%- if this.icon_create_function is not none %}
{{ this.get_name() }}.options.iconCreateFunction =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W291 trailing whitespace

@Conengmo Conengmo merged commit 25bfd5c into python-visualization:master Sep 4, 2018
@Conengmo Conengmo deleted the fix-markercluster branch September 4, 2018 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants