Skip to content

How can I get the current zoom level on each onZoom? #8

@swthate

Description

@swthate

I'm having trouble trying to figure out how I can get a hold of what the current zoom level is.

I tried registering the svgpanzoom object and using an @onZoom event then tried to access this.svgpanzoom.getZoom(). That didn't work. the onZoom actually returns nothing, not even a dummy console.log.

When I create a zoomLevel computed property and assign it this.svgpanzoom.getZoom() it does start with the minZoom of 1 that I gave it. But doesn't update as I zoom, which is why I tried to use the onZoom event above.

Am I going about this the wrong way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions