Setting duration and easing of view.animateTo()

3080
3
Jump to solution
03-14-2016 04:00 AM
StefanBoonstra
New Contributor

I am currently working on a side-project using the ArcGIS JavaScript beta API. With this API I have set up a 3D SceneView over which I animate the view's camera, using the 'animateTo()' method.

The kind of fly-by effect this creates looks really great, but I'd like to be able to customize the animation a bit more. For instance, I would like to set the animation's duration to a higher number of seconds and I'd like to set the easing of the animation to linear.

Dojo easing reference: dojo/fx/easing — The Dojo Toolkit - Reference Guide

Is this possible in the current state of the JavaScript beta API (beta 3)? How would I go about implementing this?

My animation code:

view.animateTo({

  position: [ point.longitude, point.latitude, 10 ],

  heading : bearing,

  tilt : 80
});

0 Kudos
1 Solution

Accepted Solutions
KristianEkenes
Esri Regular Contributor

The options between MapView and SceneView are not the same for animateTo() in beta3. This will change since we're still refining the design for animateTo(). We are trying to keep the two methods as consistent as possible, but be aware that it does not mean the options for animateTo() will be equal in MapView and SceneView when we release 4.0 final. This may change in a future release after 4.0, however.

View solution in original post

3 Replies
MarcBate
Occasional Contributor II

It looks like the easing can only be set on the animateTo for the MapView.  It would be nice to also be able to set it, along with the duration for the animateTo on the SceneView

MapView | API Reference | ArcGIS API for JavaScript

KristianEkenes
Esri Regular Contributor

The options between MapView and SceneView are not the same for animateTo() in beta3. This will change since we're still refining the design for animateTo(). We are trying to keep the two methods as consistent as possible, but be aware that it does not mean the options for animateTo() will be equal in MapView and SceneView when we release 4.0 final. This may change in a future release after 4.0, however.

nicogis
MVP Frequent Contributor

see also Fun with Accessors in ArcGIS JS 4.0beta1 - odoenet

we have implemented it in 'About us' in Studio A&T

0 Kudos