Issues related to animations in 10.2.2 sdk

1054
4
03-14-2014 06:45 AM
ThomasBinu
New Contributor III
After upgrading to 10.2.2, we are facing some issues that are related to the new animations introduced in the zoomTo and setExtent methods

1. Issues related to showing callouts

map.zoomToScale(somePoint, map.getMaxScale());
map.getCallout().show((Point)somePoint.getGeometry());


Use case: To show the location of a place on the map with the place name on the callout

When these statements are called together, as the map zooms and pans to the point, the callout that is shown, moves along with the map and stops at another random point when the animation ends. When the user pans the map again, the callout magically snaps back to the intended point.

If these statements are reversed,

map.getCallout().show((Point)somePoint.getGeometry());
map.zoomToScale(somePoint, map.getMaxScale());


then sometimes,  the callout is hidden while the map zooms and pans to the selected point and once the animation has stopped, the callout appears at the intended point.This is the expected behaviour. But occasionally the callout shows on the map as the animation starts and moves along the map as the map pans to the point.

Now we are using the workaround given below.


map.zoomToScale(somePoint, map.getMaxScale());
new Handler().postDelayed(new Runnable() {
   public void run() {
    map.getCallout().show(point);
   }
  }, 1500);


1500 because I noticed the zoomTo animation duration is less than 1500milliseconds.

2. Issues related to setting rotation angle and extent.

map.setExtent(someFixedExtent);
map.setRotationAngle(0);


Use case: To reset the extent and rotationangle.

If these statements are called together and the map rotation angle was greater than 0, the map does not set the correct extent.

The workaround:

 
if (map.getRotationAngle() == 0)
 map.setExtent(someFixedExtent);
else {
   map.setRotationAngle(0);
   new Handler().postDelayed(new Runnable() {
   public void run() {
 map.setExtent(someFixedExtent);
 }
    }, 1500;
  }


Any help is appreciated
0 Kudos
4 Replies
AlaaRasheed
New Contributor
Thank you, your walkaround has solved my problem posted here: http://forums.arcgis.com/threads/104523-The-new-LocationDisplayManager-Bugs-or-Not
0 Kudos
ShellyGill1
Esri Contributor

map.setExtent(someFixedExtent);
map.setRotationAngle(0);


Use case: To reset the extent and rotationangle.

If these statements are called together and the map rotation angle was greater than 0, the map does not set the correct extent.


If you call setRotationAngle and then call setExtent, with no animation at all, you will get a different eventual map extent compared to that which you get if you call setExtent and then call setRotationAngle, which makes sense, as a rotated envelope would result in a different extent for the map.  Perhaps the extent you want to set would be better represented if you change the order of the calls, as below, and make sure the first call is not animated, so that the map is immediately set to 0 degrees rotation, and then the extent is set based on that 0 rotation:

map.setRotationAngle(0, false);
map.setExtent(someFixedExtent);


If you want to have both animating, and the calls to happen in turn, then your workaround makes sense to me.

I dont have any specific comments on the callout issue, but will udpate this thread if I find anything useful out.

I think we can improve the documentation of these methods that may have animation, so I will add an issue to better document this for the next release.

UPDATE - a colleague just reminded me that it's not just the setRotationAngle method that you can turn animation off, there is also an animate parameter in setExtent too, so you can turn off the animation for that specific method as well.
0 Kudos
ShellyGill1
Esri Contributor
sometimes, the callout is hidden while the map zooms and pans to the selected point and once the animation has stopped, the callout appears at the intended point.This is the expected behaviour. But occasionally the callout shows on the map as the animation starts and moves along the map as the map pans to the point.


I have a little more information on the callout issue you mention. So as you note, the expected behaviour with the 10.2.2 release, when the map is animating, is that the callout is temporarily hidden, and when the animation completes, the callout will be drawn again, and should have automatically updated to the correct location. Which means the best way to arrange your methods is like your second code snippet, with the call to show the callout first, and then the call to zoom. It sounds like this expected behaviour is what you are seeing most of the time.

However, the occasional problem of the callout showing on the map during animation sounds like a bug, but I've not been able to reproduce when using zoomToScale - can you figure out any particular situations where this happens, to help us repro and investigate this? Do you see this on all devices, or only certain ones, or only with certain types of animation/zoom?
0 Kudos
RudolfKopriva1
New Contributor
We have simillar issue when we call zoomToResolution, which is animating and there is no way to disable the animation or detect when the animation ends. Our other animation issue is with the new onFling animation, fortunatelly the onFling can be disabled if we return true. We also noticed the Up methods of OnPanListener are no longer called. It would be nice to disable animations or get a callback when animation ends.
0 Kudos