MapPoint.MoveTo() no longer moves graphics in 10.2.4

3221
2
Jump to solution
10-13-2014 12:21 AM
CedricSeah
New Contributor II

With reference to Add graphics and text—ArcGIS Runtime SDK for .NET | ArcGIS for Developers

Using the MoveTo() method, I was able to animate the movement of Graphics as described in this page. After upgrading to 10.2.4, this is no longer the case. The MoveTo() method exists but the coordinates of the MapPoint are no longer changed.

Edit: Apparently, the MoveTo() method returns a new MapPoint which I can assign to the Graphic.
Will this be detrimental to performance? According to the page "Using MoveTo is more efficient that completely updating the graphic's geometry (that is, replacing it with a new MapPoint). When animating many graphics on the map, MoveTo will perform better."

Message was edited by: Cedric Seah

1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor

Geometries are now immutable so MoveTo() returns a new MapPoint instead of changing the current MapPoint.

The goal of the geometry immutability is mainly to gain in performances so you should not notice any performance degradation due to that.

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor

Geometries are now immutable so MoveTo() returns a new MapPoint instead of changing the current MapPoint.

The goal of the geometry immutability is mainly to gain in performances so you should not notice any performance degradation due to that.

0 Kudos
dotMorten_esri
Esri Notable Contributor

To move a graphic, just set it's geometry to the new point.

myGraphic.Geometry = myNewPoint;

Improvements has been made in the internals so that there wasn't any performance gain by using MoveTo, and it was removed since it didn't serve any purpose.