File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff 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 });
You can’t perform that action at this time.
0 commit comments