⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 overviewtool.cs

📁 web 鹰眼 mapxtreme 实现的
💻 CS
字号:
using System;
using System.Drawing;
using MapInfo.Styles;
using MapInfo.Geometry;
using MapInfo.Web.UI.WebControls;
using MapInfo.Data;
using MapInfo.Mapping;

namespace OverviewSample
{
	/// <summary>
	/// Summary description for OverviewTool.
	/// </summary>
	public class OverviewTool :MapTool
	{
		private string _clientStopMethod;
		private string _clientCodeSource = null;
		private string _name;
		public static readonly string Toolname = "OverviewTool";
		private double px;
		private double py;
		private AreaStyle s;
		private FeatureGeometry g;
		private MapInfo.Geometry.DPoint centure;
	    public event System.EventHandler Overviewtoolend ;
		
		public OverviewTool()
		{
			_name = Toolname;
			// We use MapInfo's rectangle drawing client side code
			ClientStartMethod = "MapInfoWebPointStart";
			ClientStopMethod  = "MapInfoWebPointStop";
		}
		
		
		private string _clientStartMethod;
		
	
		/// <summary>
		/// Name of the tool, by default it is ZoomInTool
		/// </summary>
		public override string Name 
		{
			get { return _name; }
			set { _name = value; }
		}

		/// <summary>
		/// Name of the client side method to set up mouse event handlers for drawing
		/// </summary>
		public override string ClientStartMethod 
		{
			get { return _clientStartMethod; }
			set { _clientStartMethod = value; }
		}

		/// <summary>
		/// Name of the client side method to cancel the mouse event handlers
		/// </summary>
		public override string ClientStopMethod 
		{
			get { return _clientStopMethod; }
			set { _clientStopMethod = value; }
		}

		/// <summary>
		/// Source or url where the client drawing code is located
		/// </summary>
		public override string ClientCodeSource 
		{
			get { return _clientCodeSource; }
			set { _clientCodeSource = value; }
		}

		/// <summary>
		/// Url of the cursor image when this tool is active
		/// </summary>
		public override string CursorUrl 
		{
			get {return ""; }
			set {; }
		}

		/// <summary>
		/// This method sets the zoom value
		/// </summary>
		/// 
		protected void OnOverviewtoolend(EventArgs e)
		{
			if(Overviewtoolend != null)
		Overviewtoolend(this,e);
		}

		
		public double getpx()
		{
			return px;
		}

		public double getpy()
		{
			return py;
		}
		public DPoint getPoint()
		{
			return centure;
		}
		
		public override void Execute(string dataString, System.Collections.ArrayList arrayList, MapInfo.Mapping.Map map) 
		{
	
			
			//ExtractPoints: 提取字符串中的点
			System.Drawing.Point [] points = base.ExtractPoints(dataString);

			px= points[0].X;
			py=points[0].Y;
//			// There will be two points, end of rectangle in screen coordinates, convert them to spatial
			
			map.DisplayTransform.FromDisplay(points[0], out centure);
		
			OnOverviewtoolend(EventArgs.Empty );			
			

				
			}
		}
	}






	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -