Skip to content

Commit 361c8ec

Browse files
mangecoeurmartinRenou
authored andcommitted
Fix: remove listeners before removing controls, since doing it the other way around seems to break rendering.
1 parent 580e53b commit 361c8ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/jupyter_leaflet/src/controls/GeomanDrawControl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,15 @@ export class LeafletGeomanDrawControlView extends LeafletControlView {
335335
}
336336

337337
remove() {
338-
this.map_view.obj.pm.removeControls();
339-
this.map_view.obj.removeLayer(this.feature_group);
340338
this.map_view.obj.off('pm:create');
341339
this.map_view.obj.off('pm:remove');
342340
this.map_view.obj.off('pm:cut');
343341
this.map_view.obj.off('pm:rotateend');
344342
this.map_view.obj.off('moveend');
345343
this.model.off('msg:custom');
346344
this.model.off('change:data');
345+
this.map_view.obj.pm.removeControls();
346+
this.map_view.obj.removeLayer(this.feature_group);
347347
return this;
348348
}
349349

0 commit comments

Comments
 (0)