Select to view content in your preferred language

how to get graphics at point

492
2
08-04-2010 10:37 PM
xariaD
by
New Contributor III
How to retrieve a graphic at particular point.
I have the mappoint and attribute value of graphic displayed in graphiclayer. How to get this graphic.
can we clear a particular graphic from graphics layer?
0 Kudos
2 Replies
AliMirzabeigi
New Contributor
If you have attribute values of your graphic and there is a unique identifier attribute, say ObjectID, then you can use a LINQ query to get the graphic:
Graphic graphic = MyFeatureLayer.Graphics.First(g => (int)g.Attributes["ObjectID"] == 32170);  // 32170 is the ObjectID that you already know
To delete a graphic you can do the following:
MyFeatureLayer.Graphics.Remove(graphic);
0 Kudos
xariaD
by
New Contributor III
Thank you so much
0 Kudos