Select to view content in your preferred language

how to get graphics at point

598
2
08-04-2010 10:37 PM
xariaD
by
Occasional Contributor
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
Emerging 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
Occasional Contributor
Thank you so much
0 Kudos