Skip to content

Commit f7f849b

Browse files
committed
Update after review comments
1 parent 888acf2 commit f7f849b

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

folium/plugins/draw.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,18 @@ class Draw(JSCSSMixin, MacroElement):
6868
var {{ this.get_name() }} = new L.Control.Draw(
6969
options
7070
).addTo( {{this._parent.get_name()}} );
71-
{{ this._parent.get_name() }}.on(
72-
L.Draw.Event.CREATED,
73-
function(e) {
74-
var layer = e.layer,
75-
type = e.layerType;
76-
var coords = JSON.stringify(layer.toGeoJSON());
77-
{%- if this.show_geometry_on_click %}
78-
layer.on('click', function() {
79-
alert(coords);
80-
console.log(coords);
81-
});
82-
{%- endif %}
83-
drawnItems_{{ this.get_name() }}.addLayer(layer);
84-
}
85-
);
71+
{{ this._parent.get_name() }}.on(L.Draw.Event.CREATED, function(e) {
72+
var layer = e.layer,
73+
type = e.layerType;
74+
var coords = JSON.stringify(layer.toGeoJSON());
75+
{%- if this.show_geometry_on_click %}
76+
layer.on('click', function() {
77+
alert(coords);
78+
console.log(coords);
79+
});
80+
{%- endif %}
81+
drawnItems_{{ this.get_name() }}.addLayer(layer);
82+
});
8683
{{ this._parent.get_name() }}.on('draw:created', function(e) {
8784
drawnItems_{{ this.get_name() }}.addLayer(e.layer);
8885
});

0 commit comments

Comments
 (0)