Skip to content

Commit 0bfaea6

Browse files
committed
Fix Mapbox trying to remove controls already removed
Fix: #249
1 parent 5acb49e commit 0bfaea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vue-mapbox-gl/composables/useControl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function useControl(ControlConstructor, { propsConfig, props, emit, event
6262
});
6363

6464
onUnmounted(() => {
65-
if (unref(control) && unref(map)) {
65+
if (unref(control) && unref(map) && unref(map).hasControl(unref(control))) {
6666
unref(map).removeControl(unref(control));
6767
}
6868
});

0 commit comments

Comments
 (0)