Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get zoom value when zoom is changed in Forge Viewer

I need to show some Sprites when the camera gets close to a building and when the camera zoom out, remove the Sprites.

Is there any event that triggered when zoom changes? Also, How can we get the current zoom value?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

There is an event trigerred when Camera changes (included zoom) :

viewer.addEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT, (e) => {
    console.log(e)
})

There is a zoom property in the event received. You will additionally find a lot of informations

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading