MapX 控件在C# 中的应用

王朝c#·作者佚名  2006-01-10
窄屏简体版  字體: |||超大  

/* * 在这段代码中,我们应用MapX控件结合老美地图做了最基本的 * 地图浏览功能:放大、缩小、拖动、全图、测量距离、测量面积。 * * 杨雨田 YangYutian@Hotmail.Com */ using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace wa { public class frmMain : System.Windows.Forms.Form { private AxMapXLib.AxMap mapMain; private double MapZoom; private double CenterX; private double CenterY; private System.Windows.Forms.StatusBar sbMain; private System.Windows.Forms.MainMenu mainMenu; private System.Windows.Forms.MenuItem miMap; private System.Windows.Forms.MenuItem miMapToolZoomIn; private System.Windows.Forms.MenuItem miMapToolZoomout; private System.Windows.Forms.MenuItem miMapToolPan; private System.Windows.Forms.MenuItem miMapToolRestore; private System.Windows.Forms.MenuItem miMapToolDistance; private System.Windows.Forms.MenuItem miMapToolArea; private System.Windows.Forms.MenuItem miMapTool; private System.ComponentModel.Container components = null; public frmMain() { InitializeComponent(); } protected override void Dispose( bool disposing ) { //略 } #region Windows 窗体设计器生成的代码 private void InitializeComponent() { //略 } #endregion [STAThread] static void Main() { Application.Run(new Form1()); } private void mapMain_PolyToolUsed(object sender, AxMapXLib.CMapXEvents_PolyToolUsedEvent e) { if(e.toolNum == 99)//测量距离 { MapXLib.Points pts = (MapXLib.Points)e.points; MapXLib.Point pt1,pt2; double d=0.0; //计算顺序两个点距离,累计得到总距离 for(int i=1;i

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航