Skip to content

Commit 7fb4faf

Browse files
committed
fix(spp_gis): null draw control before destroying map on re-render
When renderMap() destroys the old map, the MapboxDraw control's internal map reference becomes null. Later, addDrawInteraction() tried to removeControl(this.draw) from the new map, but the draw control called this.map.off() on its now-null internal reference. Fix: set this.draw = null before map.remove() so addDrawInteraction skips the removeControl call for stale controls.
1 parent 3b1faba commit 7fb4faf

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

spp_gis/static/src/js/widgets/gis_edit_map/field_gis_edit_map.esm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export class FieldGisEditMap extends Component {
133133
}
134134

135135
if (this.map) {
136+
this.draw = null;
136137
this.map.remove();
137138
}
138139

0 commit comments

Comments
 (0)