ZoomDuration in JSAPI 4

12-31-2018 11:02 AM
Occasional Contributor II

Hi All,

I am needing to customize the zoom duration, just like in this sample - Customize zoom animation | ArcGIS API for JavaScript 3.27 

I am using version 4.8 of the API and do not see a zoomDuration config property like the in 3.x version of the API.

Did this property move to another object and I just haven't found it yet? Or is there another way to achieve this customization?

Thanks for your help!


Tags (1)
0 Kudos
3 Replies
Esri Regular Contributor

Hi Jillian Stanford, you can customize the zoom duration with 4x using the goTo() method of the 2D MapView or the 3D SceneView. There are several properties that can be modified in the options parameter.

MapView.goTo() documentation

MapView | API Reference | ArcGIS API for JavaScript 4.10 

SceneView.goTo() documentation

SceneView | API Reference | ArcGIS API for JavaScript 4.10 


0 Kudos
Occasional Contributor II

Hi Noah Sager‌,

Thank you for taking the time to reply!

I see how this would work if I were calling goTo explicitly but how can I configure the view so that it uses the custom duration when the user initiates a zoom, like by scrolling the mouse wheel or using the zoom widget?

Thank you!

0 Kudos
MVP Regular Contributor

You could watch for a change in the map extent to apply the goTo method with your own options parameter.

Watch for changes | ArcGIS API for JavaScript 4.10 

Maybe watch the map view extent property for changes and intervene with your own goTo and options.

0 Kudos