新客网WWW.XKER.COM:致力做中国最专业的网络学院!
学院: 操作系统 - 网络应用 - 服务器 - 网络安全 - 工具软件 - 办公软件 - Web开发 - 数据库 - 网页设计 - 图形图像 - 媒体动画 - 硬件学堂 - 存储频道 - QQ专区
您的位置:首页 > 软件开发 > .Net开发 > Asp.net教程 > 正文:MapX 控件在C# 中的应用

MapX 控件在C# 中的应用

新客网 XKER.COM 2005-08-29 来源: 收藏本文
/* * 在这段代码中,我们应用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
收藏】 【评论】 【推荐】 【投稿】 【打印】 【关闭
发表评论
要记得去论坛讨论,点击注册新会员匿名评论
评论内容:不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
阅读排行
随机推荐
实用信息推荐