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);
  • Are you trying to do actual editing, or do you want to edit the location, just for visual purposes? Commented Aug 9, 2011 at 10:34
  • hi, just for visual purpose..but i need to do it while change map location .. and if this works i want to use the spark animate class to animate the object from one location to another. but the update funciton doesnt seem to reflect unless you force redraw by toggling display of layer programmaitcally
    – user482963
    Commented Aug 10, 2011 at 8:44
  • Why not use the esri time enable to animate?
    – Brad Nesom
    Commented Dec 7, 2011 at 15:42

1 Answer 1


Try doing:


  • hi,thanks that reloads the whole layer again and requests the server for the features again, whereas i am changing the x,y on the fly and i need to reflect the new position smoothly.. if you toggle the display that works fine but it worked for only one feature in the layer..with more than one features..it simply gets stuck
    – user482963
    Commented Aug 10, 2011 at 8:56
  • 2
    Why not copy the graphics that you want to move into a new local GraphicsLayer and refresh that layer when movement occurs? Commented Aug 10, 2011 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.