File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -421,14 +421,16 @@ class GeoJson(Layer):
421421 {% if this.style %}
422422 style: {{ this.get_name() }}_styler,
423423 {%- endif %}
424- }).addTo({{ this._parent.get_name() }});
424+ });
425+ function {{ this.get_name() }}_add (data) {
426+ {{ this.get_name() }}.addData(data)
427+ .addTo({{ this._parent.get_name() }});
428+ }
425429 {%- if this.embed %}
426- {{ this.get_name() }}.addData ({{ this.data|tojson }});
430+ {{ this.get_name() }}_add ({{ this.data|tojson }});
427431 {%- else %}
428- $.ajax({url: {{ this.embed_link|tojson }}, dataType: 'json', async: true,
429- success: function(data) {
430- {{ this.get_name() }}.addData(data);
431- }});
432+ $.ajax({{ this.embed_link|tojson }}, {dataType: 'json'})
433+ .done({{ this.get_name() }}_add);
432434 {%- endif %}
433435 {% endmacro %}
434436 """ ) # noqa
You can’t perform that action at this time.
0 commit comments