can graphics overlay be used to constantly update location marker in arcgis?

110 Views Asked by At

So i was trying to create a location display buffer which isn't available in scene map, so for this i created a triangle symbol and updated it so that every time location changed the graphic has to be erased and placed at new position like this

prevLocX=camera.location.X// initialized at start
prevLocY=camera.location.Y




  newLocX=camera.location.X
    newLocY=camera.location.Y

    callCurrentLocation();
    CallCurrentLocation()
{
if prevlocX!=newlocX && ...
{
go.Graphics.Clear();
Mappoint mp1=new Mappoint(newLocX,newLocY,SpatialReferences.wgs84);
--
--
go.graphics.add(msm1);
PrevlocX=newLocX;
PrevLocY=newLocY;
}

i know this seems redundant and inefficient but this was the best way i could think of please see if it can be made better

1

There are 1 best solutions below

0
On

Most efficient would be to keep the overlay and graphic instances and just update the geometry on the graphic with a new point each time.