diff --git a/src/leaf/control.ts b/src/leaf/control.ts index 8072d29..d6cd900 100644 --- a/src/leaf/control.ts +++ b/src/leaf/control.ts @@ -26,7 +26,7 @@ export function control({ ...props, }) - created.onAdd = onAdd ? onAdd : undefined + if (onAdd) created.onAdd = onAdd return map ? created.addTo(map) : created }