AnsweredAssumed Answered

System.Exception: Invalid argument : Invalid graphic ID!

Question asked by bwkennedy on May 21, 2015
Latest reply on May 22, 2015 by bwkennedy

Hi All,

 

I'm curious is anyone has seen this exception before and had any ideas on resolution.

 

Background:

Basically we periodically create and remove graphics in a GraphicsOverlay, something akin to the following:

 

Add:

MapPoint pt = new MapPoint(lon, lat, elev, SpatialReferences.Wgs84);

pt = GeometryEngine.Project(pt, myMapRefSsytem) as MapPoint;

Graphic g = new PictureMarkerSymbol();

g.SetSourceAsync(new Uri(iconAnno.IconPath));

myGraphicsOverlay.Graphics.Add(g);

 

Remove:

myGraphicsOverlay.Graphics.Remove(f.Gfx);

Outcomes