Пример #1
0
 private void CenterMap(NavigationData navigationData)
 {
     try
     {
         //get the current map visible extent
         IEnvelope envelope = m_displayTransformation.VisibleBounds;
         if (null == m_point)
         {
             m_point = new PointClass();
         }
         //set new map center coordinate
         m_point.PutCoords(navigationData.X, navigationData.Y);
         //center the map
         envelope.CenterAt(m_point);
         m_displayTransformation.VisibleBounds = envelope;
         //rotate the map to new angle
         m_displayTransformation.Rotation = navigationData.Azimuth;
     }
     catch (Exception ex)
     {
         System.Diagnostics.Trace.WriteLine(ex.Message);
     }
 }
 private void CenterMap(NavigationData navigationData)
 {
   try
   {
     //get the current map visible extent
     IEnvelope envelope = m_displayTransformation.VisibleBounds;
     if (null == m_point)
     {
       m_point = new PointClass();
     }
     //set new map center coordinate
     m_point.PutCoords(navigationData.X, navigationData.Y);
     //center the map
     envelope.CenterAt(m_point);
     m_displayTransformation.VisibleBounds = envelope;
     //rotate the map to new angle
     m_displayTransformation.Rotation = navigationData.Azimuth;
   }
   catch (Exception ex)
   {
     System.Diagnostics.Trace.WriteLine(ex.Message);
   }
 }