frmMain.cs
上传用户:xum6868
上传日期:2009-12-02
资源大小:102k
文件大小:149k
- using System;
- using System.IO;
- using System.Data;
- using System.Drawing;
- using System.Resources;
- using System.Reflection;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Drawing.Drawing2D;
- using System.Runtime.InteropServices;
- using Crownwood.Magic.Menus;
- using Crownwood.Magic.Common;
- using Crownwood.Magic.Controls;
- using Crownwood.Magic.Docking;
- using Crownwood.Magic.Win32;
- using UtilityLibrary.Menus;
- using UtilityLibrary.CommandBars;
- using UtilityLibrary.WinControls;
- using UtilityLibrary.General;
- using UtilityLibrary.Win32;
- using UtilityLibrary.Collections;
- namespace MainSystem
- {
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- ///
-
- public class frmMain : System.Windows.Forms.Form
- {
- enum TVType {TV_maps=1, TV_Layers, TV_Legend};
- //常量
- private const string NOFILTER = "(全部类型)";
- private const string NOSUBFILTER = "(全部子类型)";
- private const string FONTNAME = "楷体";
- private const int FONTHEIGHT = 2500;
- private const double MAX_SCALE = 4000;
- private const double MIN_SCALE = 20000;
-
- private bool _bTVChecked = true;
-
- private MapTip _mapTip = null;
- public int _nInitStatus;
- //query
- private string _query_szType= "";
- //index
- private string _index_szType= "";
- private string _index_szSubType= "";
- private bool _index_bTextBox = true;
- private bool _bus_bTextBox = true;
- //distance
- private string _dist_szType= "";
- private MapObjects2.MapLayer _netLayer = null;
- private NetLayer _netLayer1 = null;
- private ArrayList _path = null;
- public AxMapObjects2.AxMap _mapEye = null;
-
- //资源
- // private ImageList _imagesToolbar = null;
- private ImageList _imagesWorkspace = null;
- private ImageList _imagesToolbar16 = null;
- private ImageList _imagesToolbar16_2 = null;
- private ImageList _imagesMaps = null;
- private ImageList _imagesVisible = null;
- //TreeView
- private TreeView _tvMaps = null;
- private TreeView _tvLayers = null;
- private TreeView _tvLegend = null;
- //Docking Windows for map,query and help
- private DockingManager _manager = null;
- WindowContent _wc = null;
- //Content
- Crownwood.Magic.Docking.Content _cInfoWnd = null;
- Crownwood.Magic.Docking.Content _cEyeWnd = null;
- Crownwood.Magic.Docking.Content _cIndexWnd = null; //index window
- Crownwood.Magic.Docking.Content _cQueryWnd = null; //query window
- Crownwood.Magic.Docking.Content _cHelpWnd = null; //help window
-
- //Data
- public string _strMapName;
- public string _strFilter;
- public CEnvironment _environment = null;
- public frmInfo _frmInfo = null;
- //Out
- public OutlookBar _mapOutlookBar = null;
- public OutlookBar _queryOutlookBar = null;
- private System.Windows.Forms.ComboBox _comboBox;
- private System.Windows.Forms.Panel _panelBus;
- private System.Windows.Forms.Button _bus_button;
- private System.Windows.Forms.ListBox _Bus_listBox;
- private System.Windows.Forms.RadioButton _Bus_radioButton_Line;
- private System.Windows.Forms.RadioButton _Bus_radioButton_Station;
- private System.Windows.Forms.TextBox _Bus_textBox;
- private System.Windows.Forms.Panel _panelDist;
- private System.Windows.Forms.ComboBox _dist_comboBoxFilter2;
- private System.Windows.Forms.ComboBox _dist_comboBoxFilter;
- private System.Windows.Forms.Button _dist_button;
- private System.Windows.Forms.RadioButton _dist_radioButton2;
- private System.Windows.Forms.RadioButton _dist_radioButton1;
- private System.Windows.Forms.ComboBox _dist_comboBoxPos;
- private System.Windows.Forms.Label _dist_label1;
- private System.Windows.Forms.TextBox _dist_txtName;
- private System.Windows.Forms.Panel _panelIndex;
- private System.Windows.Forms.ComboBox _index_comboBoxFilter2;
- private System.Windows.Forms.ListBox _index_listBox;
- private System.Windows.Forms.ComboBox _index_comboBoxFilter;
- private System.Windows.Forms.TextBox _index_txtName;
- private System.Windows.Forms.Label _index_label2;
- private System.Windows.Forms.Label _index_label1;
- private System.Windows.Forms.Panel _panelOutput;
- private System.Windows.Forms.Button _output_button3;
- private System.Windows.Forms.Button _output_button2;
- private System.Windows.Forms.Button _output_button1;
- public System.Windows.Forms.ListBox _output_listBox;
- public System.Windows.Forms.Label _Output_label;
- private System.Windows.Forms.Panel _panelQuery;
- private System.Windows.Forms.ComboBox _query_comboBoxFilter2;
- private System.Windows.Forms.Button _query_button;
- private System.Windows.Forms.CheckBox _query_checkBox3;
- private System.Windows.Forms.CheckBox _query_checkBox2;
- private System.Windows.Forms.CheckBox _query_checkBox1;
- private System.Windows.Forms.ComboBox _query_comboBoxFilter;
- private System.Windows.Forms.TextBox _query_txtTel;
- private System.Windows.Forms.TextBox _query_txtName;
- private System.Windows.Forms.Label _query_label3;
- private System.Windows.Forms.Label _query_label2;
- private System.Windows.Forms.Label _query_label1;
- private System.Windows.Forms.Label _dis_label_Note;
- internal System.Windows.Forms.CheckBox _bus_checkBox7;
- internal System.Windows.Forms.CheckBox _bus_checkBox6;
- internal System.Windows.Forms.CheckBox _bus_checkBox5;
- internal System.Windows.Forms.CheckBox _bus_checkBox4;
- internal System.Windows.Forms.CheckBox _bus_checkBox3;
- internal System.Windows.Forms.CheckBox _bus_checkBox2;
- internal System.Windows.Forms.CheckBox _bus_checkBox1;
- public System.Windows.Forms.Timer _timer;
- private System.Windows.Forms.ToolBar _toolBar16;
- private System.Windows.Forms.StatusBarPanel statusBarPanel1;
- private System.Windows.Forms.StatusBarPanel statusBarPanel2;
- private System.Windows.Forms.StatusBarPanel statusBarPanel3;
- private System.Windows.Forms.StatusBarPanel statusBarPanel4;
- private System.Windows.Forms.StatusBar _statusBar;
- private System.Windows.Forms.ToolBar _toolBar2;
- public AxMapObjects2.AxMap _map;
- public System.Windows.Forms.PictureBox _picToolTip;
- public System.Windows.Forms.Label _lblToolTip;
- private System.ComponentModel.IContainer components;
- public frmMain()
- {
- InitializeComponent();
- //初始化参数
- _nInitStatus = 0;
- //装载资源
- LoadResources();
- CreateToolBar16();
- CreateToolBar2();
- _manager = new DockingManager(this, Crownwood.Magic.Common.VisualStyle.IDE);
- _manager.OuterControl = _statusBar;
- Initialize();
- //装载数据
- LoadData();
- CreateWorkspace();
- _mapTip = new MapTip(this);
- }
- //功能:装载资源,例如:imagelist
- //参数:无
- //返回值:void
- protected void LoadResources()
- {
- _imagesToolbar16 = ResourceHelper.LoadBitmapStrip(this.GetType(),
- "MainSystem.Toolbar16.bmp",
- new Size(16,16),
- new Point(0,0));
- _imagesToolbar16_2 = ResourceHelper.LoadBitmapStrip(this.GetType(),
- "MainSystem.Toolbar2.bmp",
- new Size(16,16),
- new Point(0,0));
- _imagesWorkspace = ResourceHelper.LoadBitmapStrip(this.GetType(),
- "MainSystem.Workspace.bmp",
- new Size(16,16),
- new Point(0,0));
- _imagesMaps = ResourceHelper.LoadBitmapStrip(this.GetType(),
- "MainSystem.Maps.bmp",
- new Size(16,16),
- new Point(0,0));
- _imagesVisible = ResourceHelper.LoadBitmapStrip(this.GetType(),
- "MainSystem.Visible.bmp",
- new Size(16,16),
- new Point(0,0));
- }
- /// <summary>
- /// 创建地名分布快捷方式工具条
- /// </summary>
- protected void CreateToolBar2()
- {
- this._toolBar2.ImageList = _imagesToolbar16_2;
-
- ToolBarButton toolBarButton0 = new ToolBarButton();
- toolBarButton0.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
- ToolBarButton toolBarButton = new ToolBarButton();
- toolBarButton.ImageIndex = 14;
- toolBarButton.ToolTipText = "所有地名";
- toolBarButton.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton.Pushed = true;
- ToolBarButton toolBarButton1 = new ToolBarButton();
- toolBarButton1.ImageIndex = 0;
- toolBarButton1.ToolTipText = "购物分布";
- toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton1.Pushed = true;
- ToolBarButton toolBarButton2 = new ToolBarButton();
- toolBarButton2.ImageIndex = 1;
- toolBarButton2.ToolTipText = "旅游点分布";
- toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton2.Pushed = true;
- ToolBarButton toolBarButton3 = new ToolBarButton();
- toolBarButton3.ImageIndex = 2;
- toolBarButton3.ToolTipText = "学校分布";
- toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton3.Pushed = true;
- ToolBarButton toolBarButton4 = new ToolBarButton();
- toolBarButton4.ImageIndex = 3;
- toolBarButton4.ToolTipText = "医院分布";
- toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton4.Pushed = true;
- ToolBarButton toolBarButton5 = new ToolBarButton();
- toolBarButton5.ImageIndex = 4;
- toolBarButton5.ToolTipText = "宾馆分布";
- toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton5.Pushed = true;
- ToolBarButton toolBarButton6 = new ToolBarButton();
- toolBarButton6.ImageIndex = 5;
- toolBarButton6.ToolTipText = "银行分布";
- toolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton6.Pushed = true;
- ToolBarButton toolBarButton7 = new ToolBarButton();
- toolBarButton7.ImageIndex = 6;
- toolBarButton7.ToolTipText = "加油站分布";
- toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton7.Pushed = true;
- ToolBarButton toolBarButton8 = new ToolBarButton();
- toolBarButton8.ImageIndex = 7;
- toolBarButton8.ToolTipText = "电影音乐厅分布";
- toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton8.Pushed = true;
- ToolBarButton toolBarButton9 = new ToolBarButton();
- toolBarButton9.ImageIndex = 8;
- toolBarButton9.ToolTipText = "餐馆分布";
- toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton9.Pushed = true;
-
- ToolBarButton toolBarButton10 = new ToolBarButton();
- toolBarButton10.ImageIndex = 9;
- toolBarButton10.ToolTipText = "WC分布";
- toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton10.Pushed = true;
-
- ToolBarButton toolBarButton11 = new ToolBarButton();
- toolBarButton11.ImageIndex = 10;
- toolBarButton11.ToolTipText = "邮局分布";
- toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton11.Pushed = true;
-
- ToolBarButton toolBarButton12 = new ToolBarButton();
- toolBarButton12.ImageIndex = 11;
- toolBarButton12.ToolTipText = "图书馆分布";
- toolBarButton12.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton12.Pushed = true;
-
- ToolBarButton toolBarButton13 = new ToolBarButton();
- toolBarButton13.ImageIndex = 12;
- toolBarButton13.ToolTipText = "车站";
- toolBarButton13.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton13.Pushed = true;
- this._toolBar2.Buttons.Add(toolBarButton0);
- this._toolBar2.Buttons.Add(toolBarButton0);
- this._toolBar2.Buttons.Add(toolBarButton);
- this._toolBar2.Buttons.Add(toolBarButton1);
- this._toolBar2.Buttons.Add(toolBarButton2);
- this._toolBar2.Buttons.Add(toolBarButton3);
- this._toolBar2.Buttons.Add(toolBarButton4);
- this._toolBar2.Buttons.Add(toolBarButton5);
- this._toolBar2.Buttons.Add(toolBarButton6);
- this._toolBar2.Buttons.Add(toolBarButton7);
- this._toolBar2.Buttons.Add(toolBarButton8);
- this._toolBar2.Buttons.Add(toolBarButton9);
- this._toolBar2.Buttons.Add(toolBarButton10);
- this._toolBar2.Buttons.Add(toolBarButton11);
- this._toolBar2.Buttons.Add(toolBarButton12);
- this._toolBar2.Buttons.Add(toolBarButton13);
- }
- protected void CreateToolBar16()
- {
- this._toolBar16.ImageList = _imagesToolbar16;
-
- ToolBarButton toolBarButton0 = new ToolBarButton();
- toolBarButton0.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
- ToolBarButton toolBarButton1 = new ToolBarButton();
- toolBarButton1.ImageIndex = 0;
- toolBarButton1.ToolTipText = "放大";
- toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton2 = new ToolBarButton();
- toolBarButton2.ImageIndex = 1;
- toolBarButton2.ToolTipText = "缩小";
- toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton3 = new ToolBarButton();
- toolBarButton3.ImageIndex = 2;
- toolBarButton3.ToolTipText = "全图显示";
- ToolBarButton toolBarButton4 = new ToolBarButton();
- toolBarButton4.ImageIndex = 3;
- toolBarButton4.ToolTipText = "漫游";
- toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton5 = new ToolBarButton();
- toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
- ToolBarButton toolBarButton7 = new ToolBarButton();
- toolBarButton7.ImageIndex = 5;
- toolBarButton7.ToolTipText = "点选择";
- toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton8 = new ToolBarButton();
- toolBarButton8.ImageIndex = 7;
- toolBarButton8.ToolTipText = "矩形选择";
- toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton9 = new ToolBarButton();
- toolBarButton9.ImageIndex = 6;
- toolBarButton9.ToolTipText = "圆选择";
- toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton10 = new ToolBarButton();
- toolBarButton10.ImageIndex = 8;
- toolBarButton10.ToolTipText = "多边形选择";
- toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton11 = new ToolBarButton();
- toolBarButton11.ImageIndex = 9;
- toolBarButton11.ToolTipText = "信息";
- toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton30 = new ToolBarButton();
- toolBarButton30.ImageIndex = 25;
- toolBarButton30.ToolTipText = "地图索引";
- ToolBarButton toolBarButton31 = new ToolBarButton();
- toolBarButton31.ImageIndex = 26;
- toolBarButton31.ToolTipText = "地图控制";
- ToolBarButton toolBarButton32 = new ToolBarButton();
- toolBarButton32.ImageIndex = 27;
- toolBarButton32.ToolTipText = "图例";
- ToolBarButton toolBarButton12 = new ToolBarButton();
- toolBarButton12.ImageIndex = 10;
- toolBarButton12.ToolTipText = "地名索引";
- ToolBarButton toolBarButton13 = new ToolBarButton();
- toolBarButton13.ImageIndex = 11;
- toolBarButton13.ToolTipText = "地名查询";
- ToolBarButton toolBarButton14 = new ToolBarButton();
- toolBarButton14.ImageIndex = 12;
- toolBarButton14.ToolTipText = "查找最近地名";
- ToolBarButton toolBarButton15 = new ToolBarButton();
- toolBarButton15.ImageIndex = 13;
- toolBarButton15.ToolTipText = "公共交通查询";
- ToolBarButton toolBarButton16 = new ToolBarButton();
- toolBarButton16.ImageIndex = 14;
- toolBarButton16.ToolTipText = "线量算";
- toolBarButton16.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton17 = new ToolBarButton();
- toolBarButton17.ImageIndex = 15;
- toolBarButton17.ToolTipText = "面量算";
- toolBarButton17.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton33 = new ToolBarButton();
- toolBarButton33.ImageIndex = 24;
- toolBarButton33.ToolTipText = "最短路径";
- toolBarButton33.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- ToolBarButton toolBarButton18 = new ToolBarButton();
- toolBarButton18.ImageIndex = 18;
- toolBarButton18.ToolTipText = "购物分布";
- toolBarButton18.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton18.Pushed = true;
- ToolBarButton toolBarButton19 = new ToolBarButton();
- toolBarButton19.ImageIndex = 19;
- toolBarButton19.ToolTipText = "旅游点分布";
- toolBarButton19.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton19.Pushed = true;
- ToolBarButton toolBarButton20 = new ToolBarButton();
- toolBarButton20.ImageIndex = 20;
- toolBarButton20.ToolTipText = "学校分布";
- toolBarButton20.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton20.Pushed = true;
- ToolBarButton toolBarButton21 = new ToolBarButton();
- toolBarButton21.ImageIndex = 21;
- toolBarButton21.ToolTipText = "医院分布";
- toolBarButton21.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
- toolBarButton21.Pushed = true;
- ToolBarButton toolBarButton22 = new ToolBarButton();
- toolBarButton22.ImageIndex = 10;
- toolBarButton22.ToolTipText = "分布图";
- ToolBarButton toolBarButton23 = new ToolBarButton();
- toolBarButton23.ImageIndex = 10;
- toolBarButton23.ToolTipText = "分布图";
- ToolBarButton toolBarButton24 = new ToolBarButton();
- toolBarButton24.ImageIndex = 16;
- toolBarButton24.ToolTipText = "打印";
- ToolBarButton toolBarButton26 = new ToolBarButton();
- toolBarButton26.ImageIndex = 22;
- toolBarButton26.ToolTipText = "帮助";
- ToolBarButton toolBarButton25 = new ToolBarButton();
- toolBarButton25.ImageIndex = 17;
- toolBarButton25.ToolTipText = "退出";
- this._toolBar16.Buttons.Add(toolBarButton0);
- this._toolBar16.Buttons.Add(toolBarButton1);
- this._toolBar16.Buttons.Add(toolBarButton2);
- this._toolBar16.Buttons.Add(toolBarButton3);
- this._toolBar16.Buttons.Add(toolBarButton4);
- this._toolBar16.Buttons.Add(toolBarButton0);
- this._toolBar16.Buttons.Add(toolBarButton7);
- this._toolBar16.Buttons.Add(toolBarButton8);
- this._toolBar16.Buttons.Add(toolBarButton10);
- this._toolBar16.Buttons.Add(toolBarButton11);
- this._toolBar16.Buttons.Add(toolBarButton0);
- this._toolBar16.Buttons.Add(toolBarButton30);
- this._toolBar16.Buttons.Add(toolBarButton31);
- this._toolBar16.Buttons.Add(toolBarButton32);
- this._toolBar16.Buttons.Add(toolBarButton12);
- this._toolBar16.Buttons.Add(toolBarButton13);
- this._toolBar16.Buttons.Add(toolBarButton14);
- this._toolBar16.Buttons.Add(toolBarButton15);
- this._toolBar16.Buttons.Add(toolBarButton16);
- this._toolBar16.Buttons.Add(toolBarButton17);
- this._toolBar16.Buttons.Add(toolBarButton33);
- this._toolBar16.Buttons.Add(toolBarButton0);
- this._toolBar16.Buttons.Add(toolBarButton24);
- this._toolBar16.Buttons.Add(toolBarButton26);
- this._toolBar16.Buttons.Add(toolBarButton25);
- }
- //功能:Create Map OutlookBar
- //参数:无
- //返回值:void
- void CreateMapOutlookBar()
- {
- // 创建地图选项卡
- _mapOutlookBar = new OutlookBar();
-
- //地图集信息
- _tvMaps = new TreeView();
- _tvMaps.ImageList = _imagesMaps;
- LoadIndexInfos(_environment.m_nCurrMapIndex);
- LoadTreeView(TVType.TV_maps );
- _tvMaps.DoubleClick += new System.EventHandler(this._tvMaps_DoubleClick);
- //图层集信息
- LoadLayerInfos(_environment.m_nCurrMapIndex);
- _tvLayers = new TreeView();
- _tvLayers.ImageList = _imagesVisible;
- LoadTreeView(TVType.TV_Layers );
- _tvLayers.AfterCheck += new TreeViewEventHandler(OnTreeViewItemChecked);
- // 加入树状列表
- _mapOutlookBar.Bands.Add(new OutlookBarBand("地图索引", _tvMaps));
- _mapOutlookBar.Bands.Add(new OutlookBarBand("地图控制", _tvLayers));
- _tvLegend = new TreeView();
- _mapOutlookBar.Bands.Add(new OutlookBarBand("图例", _tvLegend ));
- }
- /// ///////////////////////////////////////////////////////////////////////////////////////////////////
- //功能:图层控制,设置图层的可显示性
- //参数:
- //返回值:无
- /// //////////////////////////////////////////////////////////////////////////////////////////////////
- private void OnTreeViewItemChecked(object sender,TreeViewEventArgs e)
- {
- if (!_bTVChecked)
- return;
- int Level = GetNodeLevel(e.Node );
- if (e.Node.Checked)
- {
- //设置可显示
- switch (Level)
- {
- case 0:
- case 1:
- case 2:
- foreach(TreeNode node in e.Node.Nodes)
- {
- node.Checked =true;
- }
- break;
- case 3:
- {
- int nIndex = _environment.GetLayerIndexByName(e.Node.Text);
- if (nIndex >=0)
- {
- _environment.m_layerInfos[nIndex].bVisible = true;
- //判断是否在显示比例之内
- double dScale = _environment.CalcScale(_map);
- if (_environment.CalcScale(_map) < _environment.m_layerInfos[nIndex].dShowScale)
- _environment.m_layerInfos[nIndex].layer.Visible = true;
- }
- }
- break;
- }
- }
- else
- {
- //设置不可显示
- switch (Level)
- {
- case 0:
- case 1:
- case 2:
- foreach(TreeNode node in e.Node.Nodes)
- {
- node.Checked =false;
- }
- break;
- case 3:
- {
- int nIndex = _environment.GetLayerIndexByName(e.Node.Text);
- if (nIndex >=0)
- {
- _environment.m_layerInfos[nIndex].layer.Visible = false;
- _environment.m_layerInfos[nIndex].bVisible = false;
- }
- }
- break;
- }
- }
-
- _environment.m_selectedFeature = null;
- _environment.m_drawLine = null;
- _environment.m_buses = null;
- _environment.ClearSelRsts();
- ReloadToolbar();
- _map.Extent = _map.Extent;
- }
- private void LoadTreeView(TVType tvType)
- {
- switch (tvType)
- {
- case TVType.TV_maps: //地图索引
- _tvMaps.Nodes.Clear();
-
- for (int i = 0; i < _environment.m_nMapNum; i ++ )
- {
- TreeNode mapNode = new TreeNode(_environment.m_mapInfos[i].szName,0,0);
- _tvMaps.Nodes.Add(mapNode);
- LoadIndexInfos(i);
- for (int j = 0; j < _environment.m_nIndexNum; j ++)
- {
- mapNode.Nodes.Add(new TreeNode(_environment.m_indexInfos[j].szName,0,0));
- }
- mapNode.Expand();
- }
-
- LoadIndexInfos(_environment.m_nCurrMapIndex);
- break;
- case TVType.TV_Layers:
- _tvLayers.Nodes.Clear();
- _tvLayers.CheckBoxes = true;
-
- TreeNode topNode = new TreeNode("北京市图层集",0,0);
- topNode.Checked = true;
- _tvLayers.Nodes.Add(topNode);
- //分4层
- System.Data.DataTable lyTypeTbl = this._environment.m_dataSet.Tables["地名类型"];
-
- System.Data.DataRow[] rowsType = lyTypeTbl.Select();
- foreach (System.Data.DataRow myRow in rowsType)
- {
- //加第1层
- TreeNode node = new TreeNode(myRow[0].ToString());
- node.Checked = true;
- //加第2层
- System.Data.DataTable subTypeTbl = this._environment.m_dataSet.Tables["地名中类型"];
- System.Data.DataRow[] rowsSubTypes = subTypeTbl.Select("大类='"+myRow[0].ToString()+"'");
- int []aIndex = new int[_environment.m_nLayerNum];
-
- foreach (System.Data.DataRow myRow2 in rowsSubTypes)
- {
- string szSubType = myRow2["中类"].ToString();
- TreeNode node2 = new TreeNode(szSubType);
- node2.Checked = true;
- //加第3层
- int nCount = GetNodeArray2(aIndex,node.Text,szSubType);
- if (nCount > 0)
- {
- TreeNode[] nodes = new TreeNode[nCount];
-
- int count = 0;
- for (int j = 0; j < nCount; j ++)
- {
- nodes[j] = new TreeNode( _environment.m_layerInfos[aIndex[j]].szName);
-
- if (_environment.m_layerInfos[aIndex[j]].bVisible)
- nodes[j].Checked = true;
- else
- nodes[j].Checked = false;
-
- if (_environment.m_layerInfos[aIndex[j]].bCanControl)
- {
- node2.Nodes.Add(nodes[j]);
- count ++;
- }
- }
-
- if (0 == count)
- continue;
- }
- else
- {
- continue;
- }
- node.Nodes.Add(node2);
- node.Expand();
- }
- if (node.Nodes != null && node.Nodes.Count > 0 )
- {
- topNode.Nodes.Add(node);
- topNode.Expand();
- }
- }
- break;
- case TVType.TV_Legend:
- {
- }
- break;
- default:
- break;
- }
- }
- private int GetNodeArray2(int []aIndex,string szType,string szSubType)
- {
- int nCount = 0;
-
- for (int i = 0; i < _environment.m_nLayerNum; i ++)
- {
- if (_environment.m_layerInfos[i].szType .Equals(szType) && _environment.m_layerInfos[i].szSubType.Equals(szSubType))
- {
- aIndex[nCount] = new int();
- aIndex[nCount] = i;
- nCount ++;
- }
- }
- return nCount;
- }
-
-
- /////////////////////////////////////////////////////////////////////////////
- //功能:创建工作区
- //参数:无
- //返回值:void
- protected void CreateWorkspace()
- {
- //创建地图选项卡
- CreateMapOutlookBar();
- //创建查询选项卡
- CreateQueryOutlookBar();
- // 设置两个选项卡
- _cIndexWnd = _manager.Contents.Add(_mapOutlookBar, "地图",_imagesWorkspace,2);
- _cQueryWnd = _manager.Contents.Add(_queryOutlookBar, "查询",_imagesWorkspace,1);
- _cIndexWnd.CloseButton = false;
- _cIndexWnd.HideButton =false;
- _cIndexWnd.DisplaySize = new Size(this.Width/5 ,this.Height * 3 /4);
- _cIndexWnd.Control.Width = this.Width/5;
- _cQueryWnd.CloseButton = false;
- _cQueryWnd.HideButton = false;
- this.SuspendLayout();
-
- // 将地图选项卡放置在工作区的左边
- _wc = _manager.AddContentWithState(_cIndexWnd, State.DockRight) as WindowContent;
- _manager.AddContentToWindowContent(_cQueryWnd, _wc);
-
- _cQueryWnd.ParentWindowContent.ZoneArea = 125;
- _mapEye = new AxMapObjects2.AxMap();
-
- _cEyeWnd = _manager.Contents.Add(_mapEye);
- _cEyeWnd.FullTitle = "缩略图";
- _cEyeWnd.CloseButton = false;
- _cEyeWnd.HideButton = false;
- _cEyeWnd.DisplaySize = new Size(this.Width/5 ,this.Height /4);
- //2003.3.16
- this._mapEye.AfterLayerDraw += new AxMapObjects2._DMapEvents_AfterLayerDrawEventHandler(_mapEye_AfterLayerDraw);
- this._mapEye.MouseUpEvent += new AxMapObjects2._DMapEvents_MouseUpEventHandler(_mapEye_MouseUpEvent);
- _manager.AddContentToZone(_cEyeWnd, _wc.ParentZone , 1);
- _cEyeWnd.ParentWindowContent.ZoneArea = 25;
-
- this.ResumeLayout();
- }
- void CreateQueryOutlookBar()
- {
- // 创建查询选项卡
- _queryOutlookBar = new OutlookBar();
-
- // 在查询选项卡中加入面板控件
- _queryOutlookBar.Bands.Add(new OutlookBarBand("地名索引", this._panelIndex));
- _queryOutlookBar.Bands.Add(new OutlookBarBand("地名查询", this._panelQuery ));
- _queryOutlookBar.Bands.Add(new OutlookBarBand("查找最近", this._panelDist ));
- _queryOutlookBar.Bands.Add(new OutlookBarBand("公共交通查询", this._panelBus));
- InitIndexPanel();
- InitQueryPanel();
- InitDistPanel();
- InitBusPanel();
- //创建Output窗口
- _queryOutlookBar.Bands.Add(new OutlookBarBand("查询结果", this._panelOutput));
- }
- //2003.3.16
- private void _mapEye_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
- {
- if(e.index!=0)
- return;
- MapObjects2.Symbol sym = new MapObjects2.Symbol();
- sym.OutlineColor = (uint)MapObjects2.ColorConstants.moRed ;
- sym.Outline =true;
- sym.SymbolType = MapObjects2.SymbolTypeConstants.moFillSymbol;
- sym.Style = (short)MapObjects2.FillStyleConstants.moTransparentFill;
-
- _mapEye.DrawShape(_map.Extent,sym);
- }
- //2003.3.16
- private void _mapEye_MouseUpEvent(object sender, AxMapObjects2._DMapEvents_MouseUpEvent e)
- {
- MapObjects2.Symbol sym = new MapObjects2.Symbol();
- sym.OutlineColor = (uint)MapObjects2.ColorConstants.moRed ;
- sym.Outline =true;
- sym.SymbolType = MapObjects2.SymbolTypeConstants.moFillSymbol;
-
- sym.Style = (short)MapObjects2.FillStyleConstants.moTransparentFill;
- MapObjects2.Point point;
- point = _mapEye.ToMapPoint(e.x, e.y);
- _map.CenterAt(point.X,point.Y);
-
- _mapEye.Extent =_mapEye.Extent;
- }
- //Initialize
- void Initialize()
- {
- _environment = new CEnvironment();
- _environment.m_szSDBPath = Application.StartupPath + "\电子地图\";
- _environment.m_szDBName = Application.StartupPath + "\地名数据库.mdb";
- _environment.m_AppPath =Application.StartupPath;
- _environment.m_szHelpPath =Application.StartupPath + "\帮助\start.htm";
- }
- /// //////////////////////////////////////////////////////////////////////////////////////////
- //功能:Load Data
- //参数:void
- //返回值:void
- /// //////////////////////////////////////////////////////////////////////////////////////////
- void LoadData()
- {
- CreateDataSet();
-
- _environment.m_db = new MapObjects2.DataConnection();
- _environment.m_db.Database = _environment.m_szSDBPath;
- }
- //Create DatabSet
- void CreateDataSet()
- {
- string strConnectionString;
- string strDatabasePath;
- //Create connection string
- strDatabasePath = Application.StartupPath;
- strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _environment.m_szDBName +
- ";Persist Security Info=False";
- System.Data.OleDb.OleDbConnection myConnection = new System.Data.OleDb.OleDbConnection(strConnectionString);
- try
- {
- myConnection.Open();
- }
- catch(System.InvalidOperationException myException)
- {
- MessageBox.Show(
- "Message: " + myException.Message + "n" +
- "Source: " + myException.Source + "n"
- );
- }
- catch (System.Data.OleDb.OleDbException myException)
- {
- for (int i=0; i < myException.Errors.Count; i++)
- {
- MessageBox.Show("Index #" + i + "n" +
- "Message: " + myException.Errors[i].Message + "n" +
- "Native: " + myException.Errors[i].NativeError.ToString() + "n" +
- "Source: " + myException.Errors[i].Source + "n" +
- "SQL: " + myException.Errors[i].SQLState + "n");
- }
- }
-
- //创建数据库
- //创建数据字典
- _environment.m_dataSet = new System.Data.DataSet("地名数据库");
- System.Data.OleDb.OleDbDataAdapter myDataAdapter = new System.Data.OleDb.OleDbDataAdapter("Select * From 地图集信息表",myConnection);
- myDataAdapter.Fill(_environment.m_dataSet,"地图集信息表");
-
- //创建地图集
- System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables["地图集信息表"];
-
- System.Data.DataRow[] rowsMaps = mapsTbl.Select();
- _environment.m_nMapNum = rowsMaps.Length;
- _environment.m_mapInfos = new MapInfo [_environment.m_nMapNum];
- int nIndex = 0;
- foreach (System.Data.DataRow myRow in rowsMaps)
- {
- string szTableName = myRow["表名"].ToString();
- if (szTableName != "")
- {
- _environment.m_mapInfos[nIndex].szName = myRow["名称"].ToString();
- _environment.m_mapInfos[nIndex].szMetaTable = szTableName;
- _environment.m_mapInfos[nIndex].szIndexTable = myRow["索引表名"].ToString();
- myDataAdapter.SelectCommand.CommandText = "Select * From " + szTableName + " Where 存在 = True Order By 显示次序1,显示次序2,id";
- myDataAdapter.Fill(_environment.m_dataSet,szTableName);
- if (_environment.m_mapInfos[nIndex].szIndexTable != "")
- {
- myDataAdapter.SelectCommand.CommandText = "Select * From " + _environment.m_mapInfos[nIndex].szIndexTable + " Order By id";
- myDataAdapter.Fill(_environment.m_dataSet,_environment.m_mapInfos[nIndex].szIndexTable);
- }
- _environment.m_mapInfos[nIndex].rect = new MapObjects2.Rectangle();
- _environment.m_mapInfos[nIndex].rect.Left = (double)myRow["X1"];
- _environment.m_mapInfos[nIndex].rect.Top = (double)myRow["Y1"];
- _environment.m_mapInfos[nIndex].rect.Right = (double)myRow["X2"];
- _environment.m_mapInfos[nIndex].rect.Bottom = (double)myRow["Y2"];
- nIndex ++;
- }
- }
- _environment.m_nCurrMapIndex = 0;
- myDataAdapter.SelectCommand.CommandText = "Select 大类 From 地名类型";
- myDataAdapter.Fill(_environment.m_dataSet,"地名类型");
-
- myDataAdapter.SelectCommand.CommandText = "Select * From 地名中类型";
- myDataAdapter.Fill(_environment.m_dataSet,"地名中类型");
- myDataAdapter.SelectCommand.CommandText = "Select * From 地名索引";
- myDataAdapter.Fill(_environment.m_dataSet,"地名索引");
- myDataAdapter.SelectCommand.CommandText = "Select distinct 线路名 From 公交车站路线 Order By 线路名";
- myDataAdapter.Fill(_environment.m_dataSet,"公交线路");
- myDataAdapter.SelectCommand.CommandText = "Select distinct 站名 From 公交车站路线 Order By 站名";
- myDataAdapter.Fill(_environment.m_dataSet,"公交车站");
- myDataAdapter.SelectCommand.CommandText = "Select * From 公交车站";
- myDataAdapter.Fill(_environment.m_dataSet,"公交车站2");
- myDataAdapter.SelectCommand.CommandText = "Select * From 公交车站路线 Order By 线路名";
- myDataAdapter.Fill(_environment.m_dataSet,"公交车站路线");
- myDataAdapter.SelectCommand.CommandText = "Select * From AAT Order By ARCID";
- myDataAdapter.Fill(_environment.m_dataSet,"AAT");
- myDataAdapter.SelectCommand.CommandText = "Select * From NAT Order By NODEID";
- myDataAdapter.Fill(_environment.m_dataSet,"NAT");
- myConnection.Close();
- }
- //装载索引信息
- void LoadIndexInfos(int nIndex)
- {
- string szIndexTable = _environment.m_mapInfos[nIndex].szIndexTable;
-
- System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szIndexTable];
- System.Data.DataRow[] rowsMaps = mapsTbl.Select();
- _environment.m_nIndexNum = rowsMaps.Length;
- _environment.m_indexInfos = null;
- _environment.m_indexInfos = new IndexInfo[_environment.m_nIndexNum];
- int nIdx = 0;
- foreach (System.Data.DataRow myRow in rowsMaps)
- {
- _environment.m_indexInfos[nIdx].szName = myRow["名称"].ToString();
- // _environment.m_indexInfos[nIdx].dX = (double)myRow["X坐标"];
- // _environment.m_indexInfos[nIdx].dY = (double)myRow["Y坐标"];
- _environment.m_indexInfos[nIdx].m_extent = new MapObjects2.Rectangle();
- _environment.m_indexInfos[nIdx].m_extent.Top = (double)myRow["Y1"];
- _environment.m_indexInfos[nIdx].m_extent.Bottom = (double)myRow["Y2"];
- _environment.m_indexInfos[nIdx].m_extent.Right = (double)myRow["X2"];
- _environment.m_indexInfos[nIdx].m_extent.Left = (double)myRow["X1"];
-
- nIdx ++;
- }
- }
- //装载图层信息
- void LoadLayerInfos(int nIndex)
- {
- string szMetaTable = _environment.m_mapInfos[nIndex].szMetaTable;
-
- System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szMetaTable];
-
- System.Data.DataRow[] rowsMaps = mapsTbl.Select("存在=true","显示次序1,显示次序2,id");
- _environment.m_nLayerNum = rowsMaps.Length;
- _environment.m_layerInfos = null;
- _environment.m_layerInfos = new LayerInfo[_environment.m_nLayerNum];
- int nIdx = 0;
- foreach (System.Data.DataRow myRow in rowsMaps)
- {
- _environment.m_layerInfos[nIdx].szName = myRow["名称"].ToString();
- _environment.m_layerInfos[nIdx].szType = myRow["大类"].ToString();
- _environment.m_layerInfos[nIdx].szFileName = myRow["图形文件"].ToString();
- _environment.m_layerInfos[nIdx].szSubType = myRow["中类"].ToString();
- _environment.m_layerInfos[nIdx].szTableName = myRow["属性表名"].ToString();
- _environment.m_layerInfos[nIdx].szLayerName = myRow["图层名"].ToString();
- _environment.m_layerInfos[nIdx].bVisible = (bool)myRow["显示"];
- _environment.m_layerInfos[nIdx].bLable = (bool)myRow["注记"];
- _environment.m_layerInfos[nIdx].bCanSelected = (bool)myRow["选择"];
- _environment.m_layerInfos[nIdx].bCanControl = (bool)myRow["控制"];
- _environment.m_layerInfos[nIdx].bBackground = (bool)myRow["地物"];
- if (myRow["小类"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].szSubType2 = myRow["小类"].ToString();
- else
- _environment.m_layerInfos[nIdx].szSubType2 = "";
- if (myRow["次小类"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].szSubType3 = myRow["次小类"].ToString();
- else
- _environment.m_layerInfos[nIdx].szSubType3 = "";
-
- if (myRow["注记比例尺"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].dScale = (double)myRow["注记比例尺"];
- else
- _environment.m_layerInfos[nIdx].dScale = 999999999;
- if (myRow["显示比例尺"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].dShowScale = (double)myRow["显示比例尺"];
- else
- _environment.m_layerInfos[nIdx].dShowScale = 999999999;
- if (myRow["符号索引"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].nCharacterIndex = (int)myRow["符号索引"];
- else
- _environment.m_layerInfos[nIdx].nCharacterIndex = -1;
- if (myRow["注记大小"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].nFontSize = (int)myRow["注记大小"];
- else
- _environment.m_layerInfos[nIdx].nFontSize = 10;
- if (myRow["字体名称"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].szFontName = myRow["字体名称"].ToString() ;
- else
- _environment.m_layerInfos[nIdx].szFontName = "";
- if (myRow["符号大小"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].nSymSize = (int)myRow["符号大小"];
- else
- _environment.m_layerInfos[nIdx].nSymSize = 4;
- if (myRow["符号颜色"] != System.DBNull.Value)
- {
- int nColor = (int)myRow["符号颜色"];
- _environment.m_layerInfos[nIdx].nSymColor = (uint)nColor;//;
- }
- else
- {
- _environment.m_layerInfos[nIdx].nSymColor = CEnvironment.SYMBOL_COLOR_NONE;
- }
-
- if (myRow["字段名"] != System.DBNull.Value)
- _environment.m_layerInfos[nIdx].szFieldName = myRow["字段名"].ToString();
- else
- _environment.m_layerInfos[nIdx].szFieldName = "单位名称";
- if (_environment.m_layerInfos[nIdx].szLayerName.Equals("公交车站"))
- {
- _environment.m_szfntStation = _environment.m_layerInfos[nIdx].szFontName;
- _environment.m_chStation = (char)_environment.m_layerInfos[nIdx].nCharacterIndex;
- _environment.m_nfntStation = _environment.m_layerInfos[nIdx].nFontSize;
- }
- nIdx ++;
- }
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
- this._comboBox = new System.Windows.Forms.ComboBox();
- this._panelBus = new System.Windows.Forms.Panel();
- this._bus_checkBox7 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox6 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox5 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox4 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox3 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox2 = new System.Windows.Forms.CheckBox();
- this._bus_checkBox1 = new System.Windows.Forms.CheckBox();
- this._bus_button = new System.Windows.Forms.Button();
- this._Bus_listBox = new System.Windows.Forms.ListBox();
- this._Bus_radioButton_Line = new System.Windows.Forms.RadioButton();
- this._Bus_radioButton_Station = new System.Windows.Forms.RadioButton();
- this._Bus_textBox = new System.Windows.Forms.TextBox();
- this._panelDist = new System.Windows.Forms.Panel();
- this._dis_label_Note = new System.Windows.Forms.Label();
- this._dist_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
- this._dist_comboBoxFilter = new System.Windows.Forms.ComboBox();
- this._dist_button = new System.Windows.Forms.Button();
- this._dist_radioButton2 = new System.Windows.Forms.RadioButton();
- this._dist_radioButton1 = new System.Windows.Forms.RadioButton();
- this._dist_comboBoxPos = new System.Windows.Forms.ComboBox();
- this._dist_label1 = new System.Windows.Forms.Label();
- this._dist_txtName = new System.Windows.Forms.TextBox();
- this._panelIndex = new System.Windows.Forms.Panel();
- this._index_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
- this._index_listBox = new System.Windows.Forms.ListBox();
- this._index_comboBoxFilter = new System.Windows.Forms.ComboBox();
- this._index_txtName = new System.Windows.Forms.TextBox();
- this._index_label2 = new System.Windows.Forms.Label();
- this._index_label1 = new System.Windows.Forms.Label();
- this._panelOutput = new System.Windows.Forms.Panel();
- this._output_button3 = new System.Windows.Forms.Button();
- this._output_button2 = new System.Windows.Forms.Button();
- this._output_button1 = new System.Windows.Forms.Button();
- this._output_listBox = new System.Windows.Forms.ListBox();
- this._Output_label = new System.Windows.Forms.Label();
- this._panelQuery = new System.Windows.Forms.Panel();
- this._query_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
- this._query_button = new System.Windows.Forms.Button();
- this._query_checkBox3 = new System.Windows.Forms.CheckBox();
- this._query_checkBox2 = new System.Windows.Forms.CheckBox();
- this._query_checkBox1 = new System.Windows.Forms.CheckBox();
- this._query_comboBoxFilter = new System.Windows.Forms.ComboBox();
- this._query_txtTel = new System.Windows.Forms.TextBox();
- this._query_txtName = new System.Windows.Forms.TextBox();
- this._query_label3 = new System.Windows.Forms.Label();
- this._query_label2 = new System.Windows.Forms.Label();
- this._query_label1 = new System.Windows.Forms.Label();
- this._timer = new System.Windows.Forms.Timer(this.components);
- this._toolBar16 = new System.Windows.Forms.ToolBar();
- this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
- this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
- this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
- this.statusBarPanel4 = new System.Windows.Forms.StatusBarPanel();
- this._statusBar = new System.Windows.Forms.StatusBar();
- this._toolBar2 = new System.Windows.Forms.ToolBar();
- this._map = new AxMapObjects2.AxMap();
- this._picToolTip = new System.Windows.Forms.PictureBox();
- this._lblToolTip = new System.Windows.Forms.Label();
- this._panelBus.SuspendLayout();
- this._panelDist.SuspendLayout();
- this._panelIndex.SuspendLayout();
- this._panelOutput.SuspendLayout();
- this._panelQuery.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this._map)).BeginInit();
- this.SuspendLayout();
- //
- // _comboBox
- //
- this._comboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._comboBox.Items.AddRange(new object[] {
- "100%",
- "200%",
- "400%",
- "800%",
- "1600%"});
- this._comboBox.Location = new System.Drawing.Point(504, 472);
- this._comboBox.Name = "_comboBox";
- this._comboBox.Size = new System.Drawing.Size(96, 20);
- this._comboBox.TabIndex = 7;
- this._comboBox.SelectionChangeCommitted += new System.EventHandler(this._comboBox_SelectionChangeCommitted_1);
- //
- // _panelBus
- //
- this._panelBus.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left);
- this._panelBus.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._bus_checkBox7,
- this._bus_checkBox6,
- this._bus_checkBox5,
- this._bus_checkBox4,
- this._bus_checkBox3,
- this._bus_checkBox2,
- this._bus_checkBox1,
- this._bus_button,
- this._Bus_listBox,
- this._Bus_radioButton_Line,
- this._Bus_radioButton_Station,
- this._Bus_textBox});
- this._panelBus.Location = new System.Drawing.Point(248, 91);
- this._panelBus.Name = "_panelBus";
- this._panelBus.Size = new System.Drawing.Size(208, 317);
- this._panelBus.TabIndex = 9;
- this._panelBus.Visible = false;
- //
- // _bus_checkBox7
- //
- this._bus_checkBox7.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox7.Checked = true;
- this._bus_checkBox7.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox7.Location = new System.Drawing.Point(8, 264);
- this._bus_checkBox7.Name = "_bus_checkBox7";
- this._bus_checkBox7.Size = new System.Drawing.Size(64, 24);
- this._bus_checkBox7.TabIndex = 27;
- this._bus_checkBox7.Text = "地铁";
- this._bus_checkBox7.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox6
- //
- this._bus_checkBox6.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox6.Checked = true;
- this._bus_checkBox6.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox6.Location = new System.Drawing.Point(136, 240);
- this._bus_checkBox6.Name = "_bus_checkBox6";
- this._bus_checkBox6.Size = new System.Drawing.Size(64, 24);
- this._bus_checkBox6.TabIndex = 26;
- this._bus_checkBox6.Text = "夜班车";
- this._bus_checkBox6.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox5
- //
- this._bus_checkBox5.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox5.Checked = true;
- this._bus_checkBox5.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox5.Location = new System.Drawing.Point(136, 216);
- this._bus_checkBox5.Name = "_bus_checkBox5";
- this._bus_checkBox5.Size = new System.Drawing.Size(64, 24);
- this._bus_checkBox5.TabIndex = 25;
- this._bus_checkBox5.Text = "长途车";
- this._bus_checkBox5.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox4
- //
- this._bus_checkBox4.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox4.Checked = true;
- this._bus_checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox4.Location = new System.Drawing.Point(64, 240);
- this._bus_checkBox4.Name = "_bus_checkBox4";
- this._bus_checkBox4.Size = new System.Drawing.Size(88, 24);
- this._bus_checkBox4.TabIndex = 24;
- this._bus_checkBox4.Text = "巴士专线";
- this._bus_checkBox4.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox3
- //
- this._bus_checkBox3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox3.Checked = true;
- this._bus_checkBox3.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox3.Location = new System.Drawing.Point(64, 216);
- this._bus_checkBox3.Name = "_bus_checkBox3";
- this._bus_checkBox3.Size = new System.Drawing.Size(88, 24);
- this._bus_checkBox3.TabIndex = 23;
- this._bus_checkBox3.Text = "运通专线";
- this._bus_checkBox3.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox2
- //
- this._bus_checkBox2.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox2.Checked = true;
- this._bus_checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox2.Location = new System.Drawing.Point(8, 240);
- this._bus_checkBox2.Name = "_bus_checkBox2";
- this._bus_checkBox2.Size = new System.Drawing.Size(64, 24);
- this._bus_checkBox2.TabIndex = 22;
- this._bus_checkBox2.Text = "郊区车";
- this._bus_checkBox2.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_checkBox1
- //
- this._bus_checkBox1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._bus_checkBox1.Checked = true;
- this._bus_checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
- this._bus_checkBox1.Location = new System.Drawing.Point(8, 216);
- this._bus_checkBox1.Name = "_bus_checkBox1";
- this._bus_checkBox1.Size = new System.Drawing.Size(64, 24);
- this._bus_checkBox1.TabIndex = 21;
- this._bus_checkBox1.Text = "市区车";
- this._bus_checkBox1.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
- //
- // _bus_button
- //
- this._bus_button.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._bus_button.Location = new System.Drawing.Point(8, 288);
- this._bus_button.Name = "_bus_button";
- this._bus_button.Size = new System.Drawing.Size(192, 24);
- this._bus_button.TabIndex = 6;
- this._bus_button.Text = "选择乘车路线";
- this._bus_button.Click += new System.EventHandler(this._bus_button_Click);
- //
- // _Bus_listBox
- //
- this._Bus_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._Bus_listBox.ItemHeight = 12;
- this._Bus_listBox.Location = new System.Drawing.Point(8, 56);
- this._Bus_listBox.Name = "_Bus_listBox";
- this._Bus_listBox.Size = new System.Drawing.Size(192, 160);
- this._Bus_listBox.TabIndex = 5;
- this._Bus_listBox.DoubleClick += new System.EventHandler(this._Bus_listBox_DoubleClick);
- this._Bus_listBox.SelectedValueChanged += new System.EventHandler(this._Bus_listBox_SelectedValueChanged);
- //
- // _Bus_radioButton_Line
- //
- this._Bus_radioButton_Line.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._Bus_radioButton_Line.Location = new System.Drawing.Point(104, 32);
- this._Bus_radioButton_Line.Name = "_Bus_radioButton_Line";
- this._Bus_radioButton_Line.Size = new System.Drawing.Size(112, 24);
- this._Bus_radioButton_Line.TabIndex = 4;
- this._Bus_radioButton_Line.Text = "公交路线";
- //
- // _Bus_radioButton_Station
- //
- this._Bus_radioButton_Station.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._Bus_radioButton_Station.Checked = true;
- this._Bus_radioButton_Station.Location = new System.Drawing.Point(8, 32);
- this._Bus_radioButton_Station.Name = "_Bus_radioButton_Station";
- this._Bus_radioButton_Station.Size = new System.Drawing.Size(120, 24);
- this._Bus_radioButton_Station.TabIndex = 3;
- this._Bus_radioButton_Station.TabStop = true;
- this._Bus_radioButton_Station.Text = "公交车站";
- this._Bus_radioButton_Station.CheckedChanged += new System.EventHandler(this._Bus_radioButton_Station_CheckedChanged);
- //
- // _Bus_textBox
- //
- this._Bus_textBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._Bus_textBox.Location = new System.Drawing.Point(8, 8);
- this._Bus_textBox.Name = "_Bus_textBox";
- this._Bus_textBox.Size = new System.Drawing.Size(192, 21);
- this._Bus_textBox.TabIndex = 2;
- this._Bus_textBox.Text = "";
- this._Bus_textBox.TextChanged += new System.EventHandler(this._Bus_textBox_TextChanged);
- //
- // _panelDist
- //
- this._panelDist.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._dis_label_Note,
- this._dist_comboBoxFilter2,
- this._dist_comboBoxFilter,
- this._dist_button,
- this._dist_radioButton2,
- this._dist_radioButton1,
- this._dist_comboBoxPos,
- this._dist_label1,
- this._dist_txtName});
- this._panelDist.Location = new System.Drawing.Point(264, 128);
- this._panelDist.Name = "_panelDist";
- this._panelDist.Size = new System.Drawing.Size(208, 349);
- this._panelDist.TabIndex = 10;
- this._panelDist.Visible = false;
- //
- // _dis_label_Note
- //
- this._dis_label_Note.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this._dis_label_Note.Location = new System.Drawing.Point(8, 224);
- this._dis_label_Note.Name = "_dis_label_Note";
- this._dis_label_Note.Size = new System.Drawing.Size(192, 80);
- this._dis_label_Note.TabIndex = 22;
- this._dis_label_Note.Text = " 按位置查找时,选择了距离和过滤类型后,先按"搜索"按钮,然后将鼠标移动到地图上选择你所要查询的位置。";
- //
- // _dist_comboBoxFilter2
- //
- this._dist_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._dist_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._dist_comboBoxFilter2.Location = new System.Drawing.Point(8, 152);
- this._dist_comboBoxFilter2.Name = "_dist_comboBoxFilter2";
- this._dist_comboBoxFilter2.Size = new System.Drawing.Size(192, 20);
- this._dist_comboBoxFilter2.TabIndex = 21;
- //
- // _dist_comboBoxFilter
- //
- this._dist_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._dist_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._dist_comboBoxFilter.Location = new System.Drawing.Point(8, 120);
- this._dist_comboBoxFilter.Name = "_dist_comboBoxFilter";
- this._dist_comboBoxFilter.Size = new System.Drawing.Size(192, 20);
- this._dist_comboBoxFilter.TabIndex = 20;
- this._dist_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._dist_comboBoxFilter_SelectedIndexChanged);
- //
- // _dist_button
- //
- this._dist_button.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this._dist_button.Location = new System.Drawing.Point(8, 184);
- this._dist_button.Name = "_dist_button";
- this._dist_button.Size = new System.Drawing.Size(72, 24);
- this._dist_button.TabIndex = 19;
- this._dist_button.Text = "搜索";
- this._dist_button.Click += new System.EventHandler(this._dist_button_Click);
- //
- // _dist_radioButton2
- //
- this._dist_radioButton2.Checked = true;
- this._dist_radioButton2.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this._dist_radioButton2.Location = new System.Drawing.Point(8, 8);
- this._dist_radioButton2.Name = "_dist_radioButton2";
- this._dist_radioButton2.TabIndex = 18;
- this._dist_radioButton2.TabStop = true;
- this._dist_radioButton2.Text = "按位置查找";
- this._dist_radioButton2.CheckedChanged += new System.EventHandler(this._dist_radioButton2_CheckedChanged);
- //
- // _dist_radioButton1
- //
- this._dist_radioButton1.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this._dist_radioButton1.Location = new System.Drawing.Point(8, 32);
- this._dist_radioButton1.Name = "_dist_radioButton1";
- this._dist_radioButton1.TabIndex = 17;
- this._dist_radioButton1.Text = "按地名查找";
- this._dist_radioButton1.CheckedChanged += new System.EventHandler(this._dist_radioButton1_CheckedChanged);
- //
- // _dist_comboBoxPos
- //
- this._dist_comboBoxPos.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._dist_comboBoxPos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._dist_comboBoxPos.Items.AddRange(new object[] {
- "最近的",
- "10米",
- "20米",
- "50米",
- "100米",
- "200米",
- "500米",
- "1000米"});
- this._dist_comboBoxPos.Location = new System.Drawing.Point(48, 88);
- this._dist_comboBoxPos.Name = "_dist_comboBoxPos";
- this._dist_comboBoxPos.Size = new System.Drawing.Size(152, 20);
- this._dist_comboBoxPos.TabIndex = 16;
- //
- // _dist_label1
- //
- this._dist_label1.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
- this._dist_label1.Location = new System.Drawing.Point(8, 88);
- this._dist_label1.Name = "_dist_label1";
- this._dist_label1.Size = new System.Drawing.Size(32, 24);
- this._dist_label1.TabIndex = 15;
- this._dist_label1.Text = "距离";
- //
- // _dist_txtName
- //
- this._dist_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._dist_txtName.Enabled = false;
- this._dist_txtName.Location = new System.Drawing.Point(8, 56);
- this._dist_txtName.Name = "_dist_txtName";
- this._dist_txtName.Size = new System.Drawing.Size(192, 21);
- this._dist_txtName.TabIndex = 14;
- this._dist_txtName.Text = "";
- //
- // _panelIndex
- //
- this._panelIndex.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._index_comboBoxFilter2,
- this._index_listBox,
- this._index_comboBoxFilter,
- this._index_txtName,
- this._index_label2,
- this._index_label1});
- this._panelIndex.Location = new System.Drawing.Point(244, 83);
- this._panelIndex.Name = "_panelIndex";
- this._panelIndex.Size = new System.Drawing.Size(216, 328);
- this._panelIndex.TabIndex = 11;
- this._panelIndex.Visible = false;
- //
- // _index_comboBoxFilter2
- //
- this._index_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._index_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._index_comboBoxFilter2.Location = new System.Drawing.Point(8, 104);
- this._index_comboBoxFilter2.Name = "_index_comboBoxFilter2";
- this._index_comboBoxFilter2.Size = new System.Drawing.Size(200, 20);
- this._index_comboBoxFilter2.TabIndex = 13;
- this._index_comboBoxFilter2.SelectedIndexChanged += new System.EventHandler(this._index_comboBoxFilter2_SelectedIndexChanged);
- //
- // _index_listBox
- //
- this._index_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._index_listBox.ItemHeight = 12;
- this._index_listBox.Location = new System.Drawing.Point(8, 136);
- this._index_listBox.Name = "_index_listBox";
- this._index_listBox.Size = new System.Drawing.Size(200, 184);
- this._index_listBox.TabIndex = 12;
- this._index_listBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this._index_listBox_MouseDown);
- this._index_listBox.DoubleClick += new System.EventHandler(this._index_listBox_DoubleClick);
- this._index_listBox.SelectedIndexChanged += new System.EventHandler(this._index_listBox_SelectedIndexChanged);
- //
- // _index_comboBoxFilter
- //
- this._index_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._index_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._index_comboBoxFilter.Location = new System.Drawing.Point(8, 72);
- this._index_comboBoxFilter.Name = "_index_comboBoxFilter";
- this._index_comboBoxFilter.Size = new System.Drawing.Size(200, 20);
- this._index_comboBoxFilter.TabIndex = 11;
- this._index_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._index_comboBoxFilter_SelectedIndexChanged);
- //
- // _index_txtName
- //
- this._index_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._index_txtName.Location = new System.Drawing.Point(8, 24);
- this._index_txtName.Name = "_index_txtName";
- this._index_txtName.Size = new System.Drawing.Size(200, 21);
- this._index_txtName.TabIndex = 10;
- this._index_txtName.Text = "";
- this._index_txtName.TextChanged += new System.EventHandler(this._index_txtName_TextChanged);
- //
- // _index_label2
- //
- this._index_label2.Location = new System.Drawing.Point(8, 56);
- this._index_label2.Name = "_index_label2";
- this._index_label2.Size = new System.Drawing.Size(72, 16);
- this._index_label2.TabIndex = 9;
- this._index_label2.Text = "地名分类:";
- //
- // _index_label1
- //
- this._index_label1.Location = new System.Drawing.Point(8, 8);
- this._index_label1.Name = "_index_label1";
- this._index_label1.Size = new System.Drawing.Size(72, 16);
- this._index_label1.TabIndex = 8;
- this._index_label1.Text = "地名名称:";
- //
- // _panelOutput
- //
- this._panelOutput.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._output_button3,
- this._output_button2,
- this._output_button1,
- this._output_listBox,
- this._Output_label});
- this._panelOutput.Location = new System.Drawing.Point(240, 89);
- this._panelOutput.Name = "_panelOutput";
- this._panelOutput.Size = new System.Drawing.Size(224, 317);
- this._panelOutput.TabIndex = 12;
- this._panelOutput.Visible = false;
- //
- // _output_button3
- //
- this._output_button3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._output_button3.Enabled = false;
- this._output_button3.ImageIndex = 0;
- this._output_button3.Location = new System.Drawing.Point(124, 282);
- this._output_button3.Name = "_output_button3";
- this._output_button3.Size = new System.Drawing.Size(56, 24);
- this._output_button3.TabIndex = 9;
- this._output_button3.Tag = "";
- this._output_button3.Text = "定位";
- this._output_button3.Click += new System.EventHandler(this._output_button3_Click);
- //
- // _output_button2
- //
- this._output_button2.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._output_button2.Enabled = false;
- this._output_button2.ImageIndex = 0;
- this._output_button2.Location = new System.Drawing.Point(68, 282);
- this._output_button2.Name = "_output_button2";
- this._output_button2.Size = new System.Drawing.Size(56, 24);
- this._output_button2.TabIndex = 8;
- this._output_button2.Tag = "";
- this._output_button2.Text = "多媒体";
- //
- // _output_button1
- //
- this._output_button1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
- this._output_button1.Enabled = false;
- this._output_button1.ImageIndex = 0;
- this._output_button1.Location = new System.Drawing.Point(12, 282);
- this._output_button1.Name = "_output_button1";
- this._output_button1.Size = new System.Drawing.Size(56, 24);
- this._output_button1.TabIndex = 7;
- this._output_button1.Tag = "";
- this._output_button1.Text = "内容";
- this._output_button1.Click += new System.EventHandler(this._output_button1_Click);
- //
- // _output_listBox
- //
- this._output_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._output_listBox.ItemHeight = 12;
- this._output_listBox.Location = new System.Drawing.Point(12, 34);
- this._output_listBox.Name = "_output_listBox";
- this._output_listBox.Size = new System.Drawing.Size(200, 232);
- this._output_listBox.TabIndex = 6;
- this._output_listBox.SelectedIndexChanged += new System.EventHandler(this._output_listBox_SelectedIndexChanged);
- //
- // _Output_label
- //
- this._Output_label.Location = new System.Drawing.Point(12, 10);
- this._Output_label.Name = "_Output_label";
- this._Output_label.Size = new System.Drawing.Size(200, 24);
- this._Output_label.TabIndex = 5;
- //
- // _panelQuery
- //
- this._panelQuery.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._query_comboBoxFilter2,
- this._query_button,
- this._query_checkBox3,
- this._query_checkBox2,
- this._query_checkBox1,
- this._query_comboBoxFilter,
- this._query_txtTel,
- this._query_txtName,
- this._query_label3,
- this._query_label2,
- this._query_label1});
- this._panelQuery.Location = new System.Drawing.Point(244, 47);
- this._panelQuery.Name = "_panelQuery";
- this._panelQuery.Size = new System.Drawing.Size(216, 400);
- this._panelQuery.TabIndex = 13;
- this._panelQuery.Visible = false;
- //
- // _query_comboBoxFilter2
- //
- this._query_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._query_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._query_comboBoxFilter2.Location = new System.Drawing.Point(8, 152);
- this._query_comboBoxFilter2.Name = "_query_comboBoxFilter2";
- this._query_comboBoxFilter2.Size = new System.Drawing.Size(200, 20);
- this._query_comboBoxFilter2.TabIndex = 22;
- //
- // _query_button
- //
- this._query_button.Location = new System.Drawing.Point(8, 184);
- this._query_button.Name = "_query_button";
- this._query_button.Size = new System.Drawing.Size(72, 24);
- this._query_button.TabIndex = 21;
- this._query_button.Text = "搜索";
- this._query_button.Click += new System.EventHandler(this._query_button_Click);
- //
- // _query_checkBox3
- //
- this._query_checkBox3.Location = new System.Drawing.Point(8, 264);
- this._query_checkBox3.Name = "_query_checkBox3";
- this._query_checkBox3.Size = new System.Drawing.Size(176, 24);
- this._query_checkBox3.TabIndex = 20;
- this._query_checkBox3.Text = "电话为模糊查询";
- //
- // _query_checkBox2
- //
- this._query_checkBox2.Location = new System.Drawing.Point(8, 240);
- this._query_checkBox2.Name = "_query_checkBox2";
- this._query_checkBox2.Size = new System.Drawing.Size(176, 24);
- this._query_checkBox2.TabIndex = 19;
- this._query_checkBox2.Text = "地名为模糊查询";
- //
- // _query_checkBox1
- //
- this._query_checkBox1.Location = new System.Drawing.Point(8, 216);
- this._query_checkBox1.Name = "_query_checkBox1";
- this._query_checkBox1.Size = new System.Drawing.Size(176, 24);
- this._query_checkBox1.TabIndex = 18;
- this._query_checkBox1.Text = "地名和电话的组合关系为与";
- //
- // _query_comboBoxFilter
- //
- this._query_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._query_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this._query_comboBoxFilter.Location = new System.Drawing.Point(8, 120);
- this._query_comboBoxFilter.Name = "_query_comboBoxFilter";
- this._query_comboBoxFilter.Size = new System.Drawing.Size(200, 20);
- this._query_comboBoxFilter.TabIndex = 17;
- this._query_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._query_comboBoxFilter_SelectedIndexChanged);
- //
- // _query_txtTel
- //
- this._query_txtTel.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._query_txtTel.Location = new System.Drawing.Point(8, 72);
- this._query_txtTel.Name = "_query_txtTel";
- this._query_txtTel.Size = new System.Drawing.Size(200, 21);
- this._query_txtTel.TabIndex = 16;
- this._query_txtTel.Text = "";
- //
- // _query_txtName
- //
- this._query_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right);
- this._query_txtName.Location = new System.Drawing.Point(8, 24);
- this._query_txtName.Name = "_query_txtName";
- this._query_txtName.Size = new System.Drawing.Size(200, 21);
- this._query_txtName.TabIndex = 15;
- this._query_txtName.Text = "";
- //
- // _query_label3
- //
- this._query_label3.Location = new System.Drawing.Point(8, 104);
- this._query_label3.Name = "_query_label3";
- this._query_label3.Size = new System.Drawing.Size(72, 16);
- this._query_label3.TabIndex = 14;
- this._query_label3.Text = "被过滤:";
- //
- // _query_label2
- //
- this._query_label2.Location = new System.Drawing.Point(8, 56);
- this._query_label2.Name = "_query_label2";
- this._query_label2.Size = new System.Drawing.Size(72, 16);
- this._query_label2.TabIndex = 13;
- this._query_label2.Text = "电话:";
- //
- // _query_label1
- //
- this._query_label1.Location = new System.Drawing.Point(8, 8);
- this._query_label1.Name = "_query_label1";
- this._query_label1.Size = new System.Drawing.Size(72, 16);
- this._query_label1.TabIndex = 12;
- this._query_label1.Text = "地名:";
- //
- // _timer
- //
- this._timer.Enabled = true;
- this._timer.Tick += new System.EventHandler(this._timer_Tick);
- //
- // _toolBar16
- //
- this._toolBar16.DropDownArrows = true;
- this._toolBar16.Name = "_toolBar16";
- this._toolBar16.ShowToolTips = true;
- this._toolBar16.Size = new System.Drawing.Size(704, 39);
- this._toolBar16.TabIndex = 21;
- this._toolBar16.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this._toolBar16_ButtonClick);
- //
- // statusBarPanel1
- //
- this.statusBarPanel1.Text = "北京市地理信息公众查询系统";
- this.statusBarPanel1.Width = 300;
- //
- // statusBarPanel2
- //
- this.statusBarPanel2.Text = "北纬=0000.00 东经=0000.00";
- this.statusBarPanel2.Width = 200;
- //
- // statusBarPanel4
- //
- this.statusBarPanel4.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
- this.statusBarPanel4.Width = 500;
- //
- // _statusBar
- //
- this._statusBar.Location = new System.Drawing.Point(0, 470);
- this._statusBar.Name = "_statusBar";
- this._statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
- this.statusBarPanel1,
- this.statusBarPanel2,
- this.statusBarPanel3,
- this.statusBarPanel4});
- this._statusBar.ShowPanels = true;
- this._statusBar.Size = new System.Drawing.Size(704, 24);
- this._statusBar.TabIndex = 0;
- //
- // _toolBar2
- //
- this._toolBar2.Dock = System.Windows.Forms.DockStyle.Left;
- this._toolBar2.DropDownArrows = true;
- this._toolBar2.Location = new System.Drawing.Point(0, 39);
- this._toolBar2.Name = "_toolBar2";
- this._toolBar2.ShowToolTips = true;
- this._toolBar2.Size = new System.Drawing.Size(39, 431);
- this._toolBar2.TabIndex = 22;
- this._toolBar2.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this._toolBar2_ButtonClick);
- //
- // _map
- //
- this._map.Dock = System.Windows.Forms.DockStyle.Fill;
- this._map.Location = new System.Drawing.Point(39, 39);
- this._map.Name = "_map";
- this._map.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_map.OcxState")));
- this._map.Size = new System.Drawing.Size(665, 431);
- this._map.TabIndex = 24;
- this._map.MouseDownEvent += new AxMapObjects2._DMapEvents_MouseDownEventHandler(this._map_MouseDownEvent);
- this._map.AfterLayerDraw += new AxMapObjects2._DMapEvents_AfterLayerDrawEventHandler(this._map_AfterLayerDraw);
- this._map.MouseMoveEvent += new AxMapObjects2._DMapEvents_MouseMoveEventHandler(this._map_MouseMoveEvent);
- //
- // _picToolTip
- //
- this._picToolTip.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
- this._picToolTip.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this._picToolTip.Location = new System.Drawing.Point(320, 239);
- this._picToolTip.Name = "_picToolTip";
- this._picToolTip.Size = new System.Drawing.Size(64, 16);
- this._picToolTip.TabIndex = 26;
- this._picToolTip.TabStop = false;
- //
- // _lblToolTip
- //
- this._lblToolTip.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
- this._lblToolTip.Location = new System.Drawing.Point(328, 239);
- this._lblToolTip.Name = "_lblToolTip";
- this._lblToolTip.Size = new System.Drawing.Size(48, 16);
- this._lblToolTip.TabIndex = 27;
- this._lblToolTip.Text = "label1";
- //
- // frmMain
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.ClientSize = new System.Drawing.Size(704, 494);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this._lblToolTip,
- this._picToolTip,
- this._map,
- this._toolBar2,
- this._toolBar16,
- this._comboBox,
- this._statusBar,
- this._panelQuery,
- this._panelOutput,
- this._panelDist,
- this._panelIndex,
- this._panelBus});
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "frmMain";
- this.Text = "北京市地理信息公众查询系统";
- this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
- this.Resize += new System.EventHandler(this.frmMain_Resize);
- this.Closing += new System.ComponentModel.CancelEventHandler(this.frmMain_Closing);
- this.Load += new System.EventHandler(this.frmMain_Load);
- this._panelBus.ResumeLayout(false);
- this._panelDist.ResumeLayout(false);
- this._panelIndex.ResumeLayout(false);
- this._panelOutput.ResumeLayout(false);
- this._panelQuery.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this._map)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main(string[] args)
- {
- frmMain frm = new frmMain();
- Application.Run(frm);
- }
- #region Form消息处理
- /// //////////////////////////////////////////////////////////////////////////////////////////////
- ///功能:From被装载后,
- ///参数:
- ///返回值:void
- /////////////////////////////////////////////////////////////////////////////////////////////////
- private void frmMain_Load(object sender, System.EventArgs e)
- {
- if (_environment.m_nCurrMapIndex >= 0 )
- {
- // 在地图窗口中加入图层
- LoadLayers();
- // 在鹰眼窗口中加入图层
- LoadLayersForEagleEye();
- }
- ReShowLayers();
- ReloadToolbar();
- _map.Extent = _environment.m_mapInfos[0].rect;
- _map.MousePointer = MapObjects2.MousePointerConstants.moArrow;
- }
- private void frmMain_Resize(object sender, System.EventArgs e)
- {
- this._comboBox.Height = this._statusBar.Height - 4;
- this._comboBox.Top = this.Height - this._comboBox.Height - 28;
- }
- private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
- {
- //退出系统时,提示
- if (DialogResult.Cancel == MessageBox.Show("确认退出吗?","北京市地理信息公众查询系统",MessageBoxButtons.OKCancel,MessageBoxIcon.Question ))
- e.Cancel = true;
- }
- #endregion
- /////////////////////////////////////////////////////////////////////////////////////////////
- ///功能:根据每个图层的显示比例而设置图层是否显示
- ///参数:
- ///返回值
- ///////////////////////////////////////////////////////////////////////////////////////////
- private void ReShowLayers()
- {
- double dScale = _environment.CalcScale(_map); //地图显示比例
- for (int i = 0; i < _environment.m_nLayerNum; i ++)
- {
- if (!_environment.m_layerInfos[i].bVisible)
- continue;
- if (dScale < _environment.m_layerInfos[i].dShowScale)
- {
- _environment.m_layerInfos[i].layer.Visible = true;
- }
- else
- {
- _environment.m_layerInfos[i].layer.Visible = false;
- }
- }
- }
- /// <summary>
- /// 根据图层可见性,设置地名快捷方式工具条上按钮的状态
- /// </summary>
- private void ReloadToolbar()
- {
- if (_environment.GetLayerVisible((int)MapDisp.MO_HOSPITAL ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_HOTEL ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_POST ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_SCHOOL ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_STATION ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_SHOP ) &&
- _environment.GetLayerVisible((int)MapDisp.MO_TOUR ))
- {
- _toolBar2.Buttons[2].Pushed = true;
- _toolBar2.Buttons[2].ImageIndex = 13;
- }
- else
- {
- _toolBar2.Buttons[2].Pushed = false;
- _toolBar2.Buttons[2].ImageIndex = 14;
- }
- if (_environment.GetLayerVisible((int)MapDisp.MO_SHOP))
- _toolBar2.Buttons[3].Pushed = true;
- else
- _toolBar2.Buttons[3].Pushed = false;
- if (_environment.GetLayerVisible((int)MapDisp.MO_TOUR))
- _toolBar2.Buttons[4].Pushed = true;
- else
- _toolBar2.Buttons[4].Pushed = false;
- if (_environment.GetLayerVisible((int)MapDisp.MO_SCHOOL))
- _toolBar2.Buttons[5].Pushed = true;
- else
- _toolBar2.Buttons[5].Pushed = false;
- if (_environment.GetLayerVisible((int)MapDisp.MO_HOSPITAL))
- _toolBar2.Buttons[6].Pushed = true;
- else
- _toolBar2.Buttons[6].Pushed = false;
- //宾馆分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_HOTEL))
- _toolBar2.Buttons[7].Pushed = true;
- else
- _toolBar2.Buttons[7].Pushed = false;
- //银行分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_BANK ))
- _toolBar2.Buttons[8].Pushed = true;
- else
- _toolBar2.Buttons[8].Pushed = false;
- //加油站分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_GAS ))
- _toolBar2.Buttons[9].Pushed = true;
- else
- _toolBar2.Buttons[9].Pushed = false;
- //电影音乐厅分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_MOVIE ))
- _toolBar2.Buttons[10].Pushed = true;
- else
- _toolBar2.Buttons[10].Pushed = false;
- //餐馆分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_RESTAURANT ))
- _toolBar2.Buttons[11].Pushed = true;
- else
- _toolBar2.Buttons[11].Pushed = false;
- //WC分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_WS ))
- _toolBar2.Buttons[12].Pushed = true;
- else
- _toolBar2.Buttons[12].Pushed = false;
- //邮局分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_POST ))
- _toolBar2.Buttons[13].Pushed = true;
- else
- _toolBar2.Buttons[13].Pushed = false;
- //图书馆分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_LIBRAY ))
- _toolBar2.Buttons[14].Pushed = true;
- else
- _toolBar2.Buttons[14].Pushed = false;
- //车站分布
- if (_environment.GetLayerVisible((int)MapDisp.MO_STATION))
- _toolBar2.Buttons[15].Pushed = true;
- else
- _toolBar2.Buttons[15].Pushed = false;
- }
- /// //////////////////////////////////////////////////////////////////////////////////////////////
- ///功能:装载鹰眼图层
- ///参数:无
- ///返回值:void
- /////////////////////////////////////////////////////////////////////////////////////////////////
- private void LoadLayersForEagleEye()
- {
- _mapEye.Layers.Clear();
-
- for (int i = 0; i < _environment.m_nLayerNum; i ++)
- {
- MapObjects2.MapLayer layer = new MapObjects2.MapLayer();
- if (_environment.m_layerInfos[i].szType.Equals("北京纵览"))
- {
- layer.GeoDataset = _environment.m_db.FindGeoDataset(_environment.m_layerInfos[i].szFileName);
- if (layer.Valid )
- {
- if (layer.shapeType == MapObjects2.ShapeTypeConstants.moShapeTypePoint)
- continue;
- if (layer.shapeType == MapObjects2.ShapeTypeConstants.moShapeTypeLine)
- continue;
- _mapEye.Layers.Add(layer);
-
- switch (_environment.m_layerInfos[i].layer.shapeType)
- {
- case MapObjects2.ShapeTypeConstants.moShapeTypePoint:
- //点符号
- if (_environment.m_layerInfos[i].nCharacterIndex >= 0 )
- {
- stdole.StdFont fnt = new stdole.StdFont();
- fnt.Name = _environment.m_layerInfos[i].szFontName;
-
- layer.Symbol.Font = fnt;
- layer.Symbol.CharacterIndex = (short)_environment.m_layerInfos[i].nCharacterIndex;
- layer.Symbol.Style = 4;
- layer.Symbol.SymbolType = MapObjects2.SymbolTypeConstants.moPointSymbol;
- layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
- }
- else
- {
- layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
- }
- break;
- case MapObjects2.ShapeTypeConstants.moShapeTypeLine:
- //线符号
- if (_environment.m_layerInfos[i].nCharacterIndex >= 0 && _environment.m_layerInfos[i].nCharacterIndex < 5)
- {
- layer.Symbol.Style = (short)_environment.m_layerInfos[i].nCharacterIndex;
- }
- else if (_environment.m_layerInfos[i].nCharacterIndex > 0)
- {
- MOSYMBOLLib.MoPenset ps = new MOSYMBOLLib.MoPenset();
- ps.Load("LineStyle.lin");
-
- layer.Symbol.Custom = ps.get_Item(_environment.m_layerInfos[i].nCharacterIndex);
- }
- layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
- break;
- case MapObjects2.ShapeTypeConstants.moShapeTypePolygon:
- layer.Symbol.Outline = false;
- if (_environment.m_layerInfos[i].nCharacterIndex >= 0 && _environment.m_layerInfos[i].nCharacterIndex <= 10)
- {
- layer.Symbol.Style = (short)_environment.m_layerInfos[i].nCharacterIndex;
- }
- else if (100 == _environment.m_layerInfos[i].nCharacterIndex)
- {
- SetPolygonLayerColor(layer, "名称","颜色",false);
- }
- break;
- }
- //设置颜色
- if (_environment.m_layerInfos[i].nSymColor != CEnvironment.SYMBOL_COLOR_NONE)
- {
- layer.Symbol.Color =_environment.m_layerInfos[i].nSymColor;
- }
- }
- }
- }
- _mapEye.Extent = _mapEye.FullExtent;
- }
- /// //////////////////////////////////////////////////////////////////////////////////////////////
- ///功能:装载图层
- ///参数:无
- ///返回值:void
- /////////////////////////////////////////////////////////////////////////////////////////////////
- private void LoadLayers()
- {
- _map.Layers.Clear();
- _map.ScrollBars = false;
- for (int m = 0; m < 3; m ++)
- {
- for (int i = 0; i < _environment.m_nLayerNum; i ++)
- {
- MapObjects2.MapLayer layer;
- layer = new MapObjects2.MapLayer();
- MapObjects2.GeoDataset gds;
- gds = _environment.m_db.FindGeoDataset(_environment.m_layerInfos[i].szFileName);
- layer.GeoDataset = gds;
- if (layer.Valid)
- {
- switch (m)
- {
- case 0:
- if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypePolygon)
- continue;
- break;
- case 1:
- if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypeLine)
- continue;
- break;
- case 2:
- if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypePoint)
- continue;
- break;
- default:
- continue;
- }
- _environment.m_layerInfos[i].layer = layer;
- this._map._Layers.Add(_environment.m_layerInfos[i].layer);
- //设置图层是否显示
- if (!_environment.m_layerInfos[i].bVisible)
- _environment.m_layerInfos[i].layer.Visible = false;