private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap && MyMap.Extent != null)
{
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.LocationToAddressCompleted += LocatorTask_LocationToAddressCompleted;
locatorTask.Failed += LocatorTask_Failed;
// Tolerance (distance) specified in meters
double tolerance = 30;
locatorTask.LocationToAddressAsync(e.MapPoint, tolerance);
Graphic graphic = new Graphic()
{
Symbol = DefaultMarkerSymbol,
Geometry = e.MapPoint
};
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.Graphics.Clear();
graphicsLayer.Graphics.Add(graphic);
}
}