Skip to content

Commit

Permalink
Sync zoom property.
Browse files Browse the repository at this point in the history
  • Loading branch information
francois2metz committed May 7, 2024
1 parent 15d7b5b commit 1cceba4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/components/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1cceba4

Please sign in to comment.