private void DisplayAgentLocation(AGENT_IN_FIELD agent) { //Create a point and get the IPoint interface IPoint point = new PointClass(); //Set the points x and y coordinates point.PutCoords(agent.Longitude, agent.Latitude); //Set the points spatial reference - WHERE the point is coming FROM point.SpatialReference = m_GeographicCoordinateSystem; //Project the point onto the displays current spatial reference - WHERE the point is going TO point.Project(m_ProjectedCoordinateSystem); //Create a marker element and get the IElement interface IElement element = new MarkerElementClass(); //Set the elements geometry element.Geometry = point; //QI for the IMarkerElement interface from the IElement interface IMarkerElement markerElement = (IMarkerElement) element; //Set the marker symbol markerElement.Symbol = GetMarkerSymbol(agent.Located); //QI for the IElementProperties interface from the IMarkerElement interface IElementProperties elementProperties = (IElementProperties) markerElement; elementProperties.Name = agent.Located.ToString(); //Add the element to the graphics container m_GraphicsContainer.AddElement(element, 0); }
private void DisplayAgentLocation(AGENT_IN_FIELD agent) { //Create a point and get the IPoint interface IPoint point = new PointClass(); //Set the points x and y coordinates point.PutCoords(agent.Longitude, agent.Latitude); //Set the points spatial reference - WHERE the point is coming FROM point.SpatialReference = m_GeographicCoordinateSystem; //Project the point onto the displays current spatial reference - WHERE the point is going TO point.Project(m_ProjectedCoordinateSystem); //Create a marker element and get the IElement interface IElement element = new MarkerElementClass(); //Set the elements geometry element.Geometry = point; //QI for the IMarkerElement interface from the IElement interface IMarkerElement markerElement = (IMarkerElement)element; //Set the marker symbol markerElement.Symbol = GetMarkerSymbol(agent.Located); //QI for the IElementProperties interface from the IMarkerElement interface IElementProperties elementProperties = (IElementProperties)markerElement; elementProperties.Name = agent.Located.ToString(); //Add the element to the graphics container m_GraphicsContainer.AddElement(element, 0); }