From d09fc4322959805f5e1201b60414e6fdc1584f5f Mon Sep 17 00:00:00 2001 From: Frank <33519926+Conengmo@users.noreply.github.com> Date: Mon, 13 Apr 2020 13:07:09 +0200 Subject: [PATCH] Geojson: fix show when not embedding data --- folium/features.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/folium/features.py b/folium/features.py index 437e926642..4d01492f5d 100644 --- a/folium/features.py +++ b/folium/features.py @@ -422,10 +422,10 @@ class GeoJson(Layer): {% if this.style %} style: {{ this.get_name() }}_styler, {%- endif %} - }); + }).addTo({{ this._parent.get_name() }}); + function {{ this.get_name() }}_add (data) { - {{ this.get_name() }}.addData(data) - .addTo({{ this._parent.get_name() }}); + {{ this.get_name() }}.addData(data); } {%- if this.embed %} {{ this.get_name() }}_add({{ this.data|tojson }});