Skip to content

Commit

Permalink
Use synchronous ajax in GeoJson
Browse files Browse the repository at this point in the history
  • Loading branch information
Conengmo committed Jun 13, 2020
1 parent 86319bb commit b19bf20
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions folium/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,20 @@ 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);
{{ this.get_name() }}
.addData(data)
.addTo({{ this._parent.get_name() }});
}
{%- if this.embed %}
{{ this.get_name() }}_add({{ this.data|tojson }});
{%- else %}
$.ajax({{ this.embed_link|tojson }}, {dataType: 'json'})
$.ajax({{ this.embed_link|tojson }}, {dataType: 'json', async: false})
.done({{ this.get_name() }}_add);
{%- endif %}
{% endmacro %}
""") # noqa

Expand Down

0 comments on commit b19bf20

Please sign in to comment.