[GIS] Moving graphics in Esri Flex Feature Layer

animationarcgis-flex-apigeometry

I have an ESRI Flex 2.3 FeatureLayer with some graphics in it. I am able to access the graphics geometry and parse the geometry as Esris MapPoint class for Flex Api. I am calling the update(x,y,srs) function..but the change doesnt seem to reflect on the fly unless i zoom in or zoom out. I am trying to make an animation in which the point graphics would move to given locations all at once, but the update() function is not effecting on the run, I called featurelayer.refresh() but that did not help at all. Is there a way to invoke feature layer`s redraw and not refreshing it so that it doesnt request data from service again?

my code..

//movementfeatureLayer is the layer which has point
var features:ArrayCollection=movementfeatureLayer.graphicProvider as ArrayCollection;
for(var i:int=0;i<features.length;i++)
{
var g:Graphic=features.getItemAt(i) as Graphic;
var geomPoint:MapPoint=g.geometry as MapPoint;
var x:Number=geomPoint.x;
var y:Number=geomPoint.y;
(((movementfeatureLayer.graphicProvider as ArrayCollection).getItemAt(i) as Graphic).geometry as MapPoint).update(x+500,y-500,map.spatialReference);
                    }

Best Answer

Try doing:

movementfeatureLayer.refresh()

Related Question