private void OnFlashPointCommand(object obj)
{
if(amCoordGetter != null && amCoordGetter.Point != null)
{
IGeometry address = amCoordGetter.Point;
// Map und View
IMxDocument mxdoc = ArcMap.Application.Document as IMxDocument;
IActiveView activeView = mxdoc.ActivatedView;
IMap map = mxdoc.FocusMap;
IEnvelope envelope = activeView.Extent;
ClearGraphicsContainer(map);
IScreenDisplay screenDisplay = activeView.ScreenDisplay;
short screenCache = Convert.ToInt16(esriScreenCache.esriNoScreenCache);
ISpatialReference outgoingCoordSystem = map.SpatialReference;
address.Project(outgoingCoordSystem);
IRgbColor color = new RgbColorClass();
color.Green = 80;
color.Red = 22;
color.Blue = 68;
ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol();
simpleMarkerSymbol.Color = color;
simpleMarkerSymbol.Size = 15;
simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSDiamond;
IElement element = null;
IMarkerElement markerElement = new MarkerElementClass();
markerElement.Symbol = simpleMarkerSymbol;
element = markerElement as IElement;
IPolygon poly = null;
if (InputCoordinateType == CoordinateType.MGRS || InputCoordinateType == CoordinateType.USNG)
{
poly = GetMGRSPolygon(address as IPoint);
}
if (poly != null)
{
address = poly;
}
var av = mxdoc.FocusMap as IActiveView;
FlashGeometry(address, color, av.ScreenDisplay, 500, av.Extent);
//AddElement(map, address);
// do not center if in layout view
//if (mxdoc.ActiveView is IMap)
//{
// if (poly != null && !poly.IsEmpty && (poly as IArea) != null)
// envelope.CenterAt((poly as IArea).Centroid);
// else
// envelope.CenterAt(amCoordGetter.Point);
// activeView.Extent = envelope;
// activeView.Refresh();
//}
}
}