We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5b367b commit 0cdce5dCopy full SHA for 0cdce5d
js/src/controls/DrawControl.js
@@ -122,6 +122,13 @@ export class LeafletDrawControlView extends control.LeafletControlView {
122
this.model.on('change:data', this.data_to_layers.bind(this));
123
}
124
125
+ remove() {
126
+ this.map_view.obj.removeLayer(this.feature_group);
127
+ this.map_view.obj.off('draw:created');
128
+ this.map_view.obj.off('draw:edited');
129
+ this.map_view.obj.off('draw:deleted');
130
+ }
131
+
132
data_to_layers() {
133
const data = this.model.get('data');
134
this.feature_group.clearLayers();
@@ -181,5 +188,6 @@ export class LeafletDrawControlView extends control.LeafletControlView {
181
188
182
189
});
183
190
191
+ this.layers_to_data()
184
192
185
193
0 commit comments