File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,15 @@ export class LeafletDrawControlView extends control.LeafletControlView {
122
122
this . model . on ( 'change:data' , this . data_to_layers . bind ( this ) ) ;
123
123
}
124
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
+ this . model . off ( 'msg:custom' ) ;
131
+ this . model . off ( 'change:data' ) ;
132
+ }
133
+
125
134
data_to_layers ( ) {
126
135
const data = this . model . get ( 'data' ) ;
127
136
this . feature_group . clearLayers ( ) ;
@@ -181,5 +190,6 @@ export class LeafletDrawControlView extends control.LeafletControlView {
181
190
}
182
191
} ) ;
183
192
}
193
+ this . layers_to_data ( )
184
194
}
185
195
}
You can’t perform that action at this time.
0 commit comments