From 1cceba450df739eb1d5f87510d4e6f3bc7e19656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20de=20Metz?= Date: Tue, 7 May 2024 09:21:36 +0200 Subject: [PATCH] Sync zoom property. --- lib/components/map.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/components/map.component.ts b/lib/components/map.component.ts index 1993b85..c7ea26e 100644 --- a/lib/components/map.component.ts +++ b/lib/components/map.component.ts @@ -384,6 +384,8 @@ export default defineComponent({ "map:pitch", "map:pitchend", "map:wheel", + // Zoom property updated + "update:zoom" ], slots: Object as SlotsType<{ default: {} }>, setup(props, ctx) { @@ -582,6 +584,9 @@ export default defineComponent({ ); map.value.once("styledata", onStyleReady); map.value.on("load", boundMapEvents.get("__load") as any); + map.value.on("zoomend", () => { + ctx.emit("update:zoom", map.value!.getZoom()); + }); // bind events if (component.vnode.props) {