frmMain.cs
上传用户:xum6868
上传日期:2009-12-02
资源大小:102k
文件大小:149k
源码类别:

GIS编程

开发平台:

C#

  1. using System;
  2. using System.IO;
  3. using System.Data;
  4. using System.Drawing;
  5. using System.Resources;
  6. using System.Reflection;
  7. using System.Collections;
  8. using System.ComponentModel;
  9. using System.Windows.Forms;
  10. using System.Drawing.Drawing2D;
  11. using System.Runtime.InteropServices;  
  12. using Crownwood.Magic.Menus;
  13. using Crownwood.Magic.Common;
  14. using Crownwood.Magic.Controls;
  15. using Crownwood.Magic.Docking;
  16. using Crownwood.Magic.Win32;
  17. using UtilityLibrary.Menus;
  18. using UtilityLibrary.CommandBars;
  19. using UtilityLibrary.WinControls;
  20. using UtilityLibrary.General;
  21. using UtilityLibrary.Win32;
  22. using UtilityLibrary.Collections;
  23. namespace MainSystem
  24. {
  25. /// <summary>
  26. /// Summary description for Form1.
  27. /// </summary>
  28. /// 
  29. public class frmMain : System.Windows.Forms.Form
  30. {
  31. enum TVType {TV_maps=1, TV_Layers, TV_Legend};
  32. //常量
  33. private const string NOFILTER = "(全部类型)";
  34. private const string NOSUBFILTER = "(全部子类型)";
  35. private const string FONTNAME = "楷体";
  36. private const int  FONTHEIGHT = 2500;
  37. private const double MAX_SCALE = 4000;
  38. private const double MIN_SCALE = 20000;
  39. private bool _bTVChecked = true;
  40. private MapTip _mapTip = null;
  41. public int _nInitStatus;
  42. //query
  43. private string _query_szType= "";
  44. //index
  45. private string _index_szType= "";
  46. private string _index_szSubType= "";
  47. private bool _index_bTextBox = true;
  48. private bool _bus_bTextBox = true;
  49. //distance
  50. private string _dist_szType= "";
  51. private MapObjects2.MapLayer _netLayer = null;
  52. private NetLayer _netLayer1 = null;
  53. private ArrayList _path = null;
  54. public AxMapObjects2.AxMap _mapEye = null;
  55. //资源
  56. // private ImageList _imagesToolbar = null;
  57. private ImageList _imagesWorkspace = null;
  58. private ImageList _imagesToolbar16 = null;
  59. private ImageList _imagesToolbar16_2 = null;
  60. private ImageList _imagesMaps = null;
  61. private ImageList _imagesVisible = null;
  62. //TreeView
  63. private TreeView _tvMaps = null;
  64. private TreeView _tvLayers = null;
  65. private TreeView _tvLegend = null;
  66. //Docking Windows for map,query and help
  67. private DockingManager _manager = null;
  68. WindowContent _wc = null;
  69. //Content
  70. Crownwood.Magic.Docking.Content _cInfoWnd = null;
  71. Crownwood.Magic.Docking.Content _cEyeWnd = null;
  72. Crownwood.Magic.Docking.Content _cIndexWnd = null; //index window
  73. Crownwood.Magic.Docking.Content _cQueryWnd = null; //query window
  74. Crownwood.Magic.Docking.Content _cHelpWnd = null; //help window
  75. //Data
  76. public string _strMapName;
  77. public string _strFilter;
  78. public CEnvironment _environment = null;
  79. public frmInfo   _frmInfo = null;
  80. //Out
  81. public OutlookBar _mapOutlookBar = null;
  82. public OutlookBar _queryOutlookBar = null;
  83. private System.Windows.Forms.ComboBox _comboBox;
  84. private System.Windows.Forms.Panel _panelBus;
  85. private System.Windows.Forms.Button _bus_button;
  86. private System.Windows.Forms.ListBox _Bus_listBox;
  87. private System.Windows.Forms.RadioButton _Bus_radioButton_Line;
  88. private System.Windows.Forms.RadioButton _Bus_radioButton_Station;
  89. private System.Windows.Forms.TextBox _Bus_textBox;
  90. private System.Windows.Forms.Panel _panelDist;
  91. private System.Windows.Forms.ComboBox _dist_comboBoxFilter2;
  92. private System.Windows.Forms.ComboBox _dist_comboBoxFilter;
  93. private System.Windows.Forms.Button _dist_button;
  94. private System.Windows.Forms.RadioButton _dist_radioButton2;
  95. private System.Windows.Forms.RadioButton _dist_radioButton1;
  96. private System.Windows.Forms.ComboBox _dist_comboBoxPos;
  97. private System.Windows.Forms.Label _dist_label1;
  98. private System.Windows.Forms.TextBox _dist_txtName;
  99. private System.Windows.Forms.Panel _panelIndex;
  100. private System.Windows.Forms.ComboBox _index_comboBoxFilter2;
  101. private System.Windows.Forms.ListBox _index_listBox;
  102. private System.Windows.Forms.ComboBox _index_comboBoxFilter;
  103. private System.Windows.Forms.TextBox _index_txtName;
  104. private System.Windows.Forms.Label _index_label2;
  105. private System.Windows.Forms.Label _index_label1;
  106. private System.Windows.Forms.Panel _panelOutput;
  107. private System.Windows.Forms.Button _output_button3;
  108. private System.Windows.Forms.Button _output_button2;
  109. private System.Windows.Forms.Button _output_button1;
  110. public System.Windows.Forms.ListBox _output_listBox;
  111. public System.Windows.Forms.Label _Output_label;
  112. private System.Windows.Forms.Panel _panelQuery;
  113. private System.Windows.Forms.ComboBox _query_comboBoxFilter2;
  114. private System.Windows.Forms.Button _query_button;
  115. private System.Windows.Forms.CheckBox _query_checkBox3;
  116. private System.Windows.Forms.CheckBox _query_checkBox2;
  117. private System.Windows.Forms.CheckBox _query_checkBox1;
  118. private System.Windows.Forms.ComboBox _query_comboBoxFilter;
  119. private System.Windows.Forms.TextBox _query_txtTel;
  120. private System.Windows.Forms.TextBox _query_txtName;
  121. private System.Windows.Forms.Label _query_label3;
  122. private System.Windows.Forms.Label _query_label2;
  123. private System.Windows.Forms.Label _query_label1;
  124. private System.Windows.Forms.Label _dis_label_Note;
  125. internal System.Windows.Forms.CheckBox _bus_checkBox7;
  126. internal System.Windows.Forms.CheckBox _bus_checkBox6;
  127. internal System.Windows.Forms.CheckBox _bus_checkBox5;
  128. internal System.Windows.Forms.CheckBox _bus_checkBox4;
  129. internal System.Windows.Forms.CheckBox _bus_checkBox3;
  130. internal System.Windows.Forms.CheckBox _bus_checkBox2;
  131. internal System.Windows.Forms.CheckBox _bus_checkBox1;
  132. public System.Windows.Forms.Timer _timer;
  133. private System.Windows.Forms.ToolBar _toolBar16;
  134. private System.Windows.Forms.StatusBarPanel statusBarPanel1;
  135. private System.Windows.Forms.StatusBarPanel statusBarPanel2;
  136. private System.Windows.Forms.StatusBarPanel statusBarPanel3;
  137. private System.Windows.Forms.StatusBarPanel statusBarPanel4;
  138. private System.Windows.Forms.StatusBar _statusBar;
  139. private System.Windows.Forms.ToolBar _toolBar2;
  140. public AxMapObjects2.AxMap _map;
  141. public System.Windows.Forms.PictureBox _picToolTip;
  142. public System.Windows.Forms.Label _lblToolTip;
  143. private System.ComponentModel.IContainer components;
  144. public frmMain()
  145. {
  146. InitializeComponent();
  147. //初始化参数
  148. _nInitStatus = 0;
  149. //装载资源
  150. LoadResources();
  151. CreateToolBar16();
  152. CreateToolBar2();
  153. _manager = new DockingManager(this, Crownwood.Magic.Common.VisualStyle.IDE);
  154. _manager.OuterControl = _statusBar;
  155. Initialize();
  156. //装载数据
  157. LoadData();
  158. CreateWorkspace();
  159. _mapTip = new MapTip(this);
  160. }
  161. //功能:装载资源,例如:imagelist
  162. //参数:无
  163. //返回值:void
  164. protected void LoadResources()
  165. {
  166. _imagesToolbar16 = ResourceHelper.LoadBitmapStrip(this.GetType(),
  167. "MainSystem.Toolbar16.bmp",
  168. new Size(16,16),
  169. new Point(0,0));
  170. _imagesToolbar16_2 = ResourceHelper.LoadBitmapStrip(this.GetType(),
  171. "MainSystem.Toolbar2.bmp",
  172. new Size(16,16),
  173. new Point(0,0));
  174. _imagesWorkspace = ResourceHelper.LoadBitmapStrip(this.GetType(),
  175. "MainSystem.Workspace.bmp",
  176. new Size(16,16),
  177. new Point(0,0));
  178. _imagesMaps = ResourceHelper.LoadBitmapStrip(this.GetType(),
  179. "MainSystem.Maps.bmp",
  180. new Size(16,16),
  181. new Point(0,0));
  182. _imagesVisible = ResourceHelper.LoadBitmapStrip(this.GetType(),
  183. "MainSystem.Visible.bmp",
  184. new Size(16,16),
  185. new Point(0,0));
  186. }
  187. /// <summary>
  188. /// 创建地名分布快捷方式工具条
  189. /// </summary>
  190. protected void CreateToolBar2()
  191. {
  192. this._toolBar2.ImageList = _imagesToolbar16_2;
  193.  
  194. ToolBarButton toolBarButton0 = new ToolBarButton();
  195. toolBarButton0.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  196. ToolBarButton toolBarButton = new ToolBarButton();
  197. toolBarButton.ImageIndex = 14;
  198. toolBarButton.ToolTipText = "所有地名";
  199. toolBarButton.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  200. toolBarButton.Pushed = true;
  201. ToolBarButton toolBarButton1 = new ToolBarButton();
  202. toolBarButton1.ImageIndex = 0;
  203. toolBarButton1.ToolTipText = "购物分布";
  204. toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  205. toolBarButton1.Pushed = true;
  206. ToolBarButton toolBarButton2 = new ToolBarButton();
  207. toolBarButton2.ImageIndex = 1;
  208. toolBarButton2.ToolTipText = "旅游点分布";
  209. toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  210. toolBarButton2.Pushed = true;
  211. ToolBarButton toolBarButton3 = new ToolBarButton();
  212. toolBarButton3.ImageIndex = 2;
  213. toolBarButton3.ToolTipText = "学校分布";
  214. toolBarButton3.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  215. toolBarButton3.Pushed = true;
  216. ToolBarButton toolBarButton4 = new ToolBarButton();
  217. toolBarButton4.ImageIndex = 3;
  218. toolBarButton4.ToolTipText = "医院分布";
  219. toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  220. toolBarButton4.Pushed = true;
  221. ToolBarButton toolBarButton5 = new ToolBarButton();
  222. toolBarButton5.ImageIndex = 4;
  223. toolBarButton5.ToolTipText = "宾馆分布";
  224. toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  225. toolBarButton5.Pushed = true;
  226. ToolBarButton toolBarButton6 = new ToolBarButton();
  227. toolBarButton6.ImageIndex = 5;
  228. toolBarButton6.ToolTipText = "银行分布";
  229. toolBarButton6.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  230. toolBarButton6.Pushed = true;
  231. ToolBarButton toolBarButton7 = new ToolBarButton();
  232. toolBarButton7.ImageIndex = 6;
  233. toolBarButton7.ToolTipText = "加油站分布";
  234. toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  235. toolBarButton7.Pushed = true;
  236. ToolBarButton toolBarButton8 = new ToolBarButton();
  237. toolBarButton8.ImageIndex = 7;
  238. toolBarButton8.ToolTipText = "电影音乐厅分布";
  239. toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  240. toolBarButton8.Pushed = true;
  241. ToolBarButton toolBarButton9 = new ToolBarButton();
  242. toolBarButton9.ImageIndex = 8;
  243. toolBarButton9.ToolTipText = "餐馆分布";
  244. toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  245. toolBarButton9.Pushed = true;
  246. ToolBarButton toolBarButton10 = new ToolBarButton();
  247. toolBarButton10.ImageIndex = 9;
  248. toolBarButton10.ToolTipText = "WC分布";
  249. toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  250. toolBarButton10.Pushed = true;
  251. ToolBarButton toolBarButton11 = new ToolBarButton();
  252. toolBarButton11.ImageIndex = 10;
  253. toolBarButton11.ToolTipText = "邮局分布";
  254. toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  255. toolBarButton11.Pushed = true;
  256. ToolBarButton toolBarButton12 = new ToolBarButton();
  257. toolBarButton12.ImageIndex = 11;
  258. toolBarButton12.ToolTipText = "图书馆分布";
  259. toolBarButton12.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  260. toolBarButton12.Pushed = true;
  261. ToolBarButton toolBarButton13 = new ToolBarButton();
  262. toolBarButton13.ImageIndex = 12;
  263. toolBarButton13.ToolTipText = "车站";
  264. toolBarButton13.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  265. toolBarButton13.Pushed = true;
  266. this._toolBar2.Buttons.Add(toolBarButton0);   
  267. this._toolBar2.Buttons.Add(toolBarButton0);   
  268. this._toolBar2.Buttons.Add(toolBarButton);   
  269. this._toolBar2.Buttons.Add(toolBarButton1);   
  270. this._toolBar2.Buttons.Add(toolBarButton2);   
  271. this._toolBar2.Buttons.Add(toolBarButton3);   
  272. this._toolBar2.Buttons.Add(toolBarButton4);   
  273. this._toolBar2.Buttons.Add(toolBarButton5);   
  274. this._toolBar2.Buttons.Add(toolBarButton6);   
  275. this._toolBar2.Buttons.Add(toolBarButton7);   
  276. this._toolBar2.Buttons.Add(toolBarButton8);   
  277. this._toolBar2.Buttons.Add(toolBarButton9);   
  278. this._toolBar2.Buttons.Add(toolBarButton10);   
  279. this._toolBar2.Buttons.Add(toolBarButton11);   
  280. this._toolBar2.Buttons.Add(toolBarButton12);   
  281. this._toolBar2.Buttons.Add(toolBarButton13);   
  282. }
  283. protected void CreateToolBar16()
  284. {
  285. this._toolBar16.ImageList = _imagesToolbar16;
  286.  
  287. ToolBarButton toolBarButton0 = new ToolBarButton();
  288. toolBarButton0.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  289. ToolBarButton toolBarButton1 = new ToolBarButton();
  290. toolBarButton1.ImageIndex = 0;
  291. toolBarButton1.ToolTipText = "放大";
  292. toolBarButton1.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  293. ToolBarButton toolBarButton2 = new ToolBarButton();
  294. toolBarButton2.ImageIndex = 1;
  295. toolBarButton2.ToolTipText = "缩小";
  296. toolBarButton2.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  297. ToolBarButton toolBarButton3 = new ToolBarButton();
  298. toolBarButton3.ImageIndex = 2;
  299. toolBarButton3.ToolTipText = "全图显示";
  300. ToolBarButton toolBarButton4 = new ToolBarButton();
  301. toolBarButton4.ImageIndex = 3;
  302. toolBarButton4.ToolTipText = "漫游";
  303. toolBarButton4.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  304. ToolBarButton toolBarButton5 = new ToolBarButton();
  305. toolBarButton5.Style = System.Windows.Forms.ToolBarButtonStyle.Separator;
  306. ToolBarButton toolBarButton7 = new ToolBarButton();
  307. toolBarButton7.ImageIndex = 5;
  308. toolBarButton7.ToolTipText = "点选择";
  309. toolBarButton7.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  310. ToolBarButton toolBarButton8 = new ToolBarButton();
  311. toolBarButton8.ImageIndex = 7;
  312. toolBarButton8.ToolTipText = "矩形选择";
  313. toolBarButton8.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  314. ToolBarButton toolBarButton9 = new ToolBarButton();
  315. toolBarButton9.ImageIndex = 6;
  316. toolBarButton9.ToolTipText = "圆选择";
  317. toolBarButton9.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  318. ToolBarButton toolBarButton10 = new ToolBarButton();
  319. toolBarButton10.ImageIndex = 8;
  320. toolBarButton10.ToolTipText = "多边形选择";
  321. toolBarButton10.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  322. ToolBarButton toolBarButton11 = new ToolBarButton();
  323. toolBarButton11.ImageIndex = 9;
  324. toolBarButton11.ToolTipText = "信息";
  325. toolBarButton11.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  326. ToolBarButton toolBarButton30 = new ToolBarButton();
  327. toolBarButton30.ImageIndex = 25;
  328. toolBarButton30.ToolTipText = "地图索引";
  329. ToolBarButton toolBarButton31 = new ToolBarButton();
  330. toolBarButton31.ImageIndex = 26;
  331. toolBarButton31.ToolTipText = "地图控制";
  332. ToolBarButton toolBarButton32 = new ToolBarButton();
  333. toolBarButton32.ImageIndex = 27;
  334. toolBarButton32.ToolTipText = "图例";
  335. ToolBarButton toolBarButton12 = new ToolBarButton();
  336. toolBarButton12.ImageIndex = 10;
  337. toolBarButton12.ToolTipText = "地名索引";
  338. ToolBarButton toolBarButton13 = new ToolBarButton();
  339. toolBarButton13.ImageIndex = 11;
  340. toolBarButton13.ToolTipText = "地名查询";
  341. ToolBarButton toolBarButton14 = new ToolBarButton();
  342. toolBarButton14.ImageIndex = 12;
  343. toolBarButton14.ToolTipText = "查找最近地名";
  344. ToolBarButton toolBarButton15 = new ToolBarButton();
  345. toolBarButton15.ImageIndex = 13;
  346. toolBarButton15.ToolTipText = "公共交通查询";
  347. ToolBarButton toolBarButton16 = new ToolBarButton();
  348. toolBarButton16.ImageIndex = 14;
  349. toolBarButton16.ToolTipText = "线量算";
  350. toolBarButton16.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  351. ToolBarButton toolBarButton17 = new ToolBarButton();
  352. toolBarButton17.ImageIndex = 15;
  353. toolBarButton17.ToolTipText = "面量算";
  354. toolBarButton17.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  355. ToolBarButton toolBarButton33 = new ToolBarButton();
  356. toolBarButton33.ImageIndex = 24;
  357. toolBarButton33.ToolTipText = "最短路径";
  358. toolBarButton33.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  359. ToolBarButton toolBarButton18 = new ToolBarButton();
  360. toolBarButton18.ImageIndex = 18;
  361. toolBarButton18.ToolTipText = "购物分布";
  362. toolBarButton18.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  363. toolBarButton18.Pushed = true;
  364. ToolBarButton toolBarButton19 = new ToolBarButton();
  365. toolBarButton19.ImageIndex = 19;
  366. toolBarButton19.ToolTipText = "旅游点分布";
  367. toolBarButton19.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  368. toolBarButton19.Pushed = true;
  369. ToolBarButton toolBarButton20 = new ToolBarButton();
  370. toolBarButton20.ImageIndex = 20;
  371. toolBarButton20.ToolTipText = "学校分布";
  372. toolBarButton20.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  373. toolBarButton20.Pushed = true;
  374. ToolBarButton toolBarButton21 = new ToolBarButton();
  375. toolBarButton21.ImageIndex = 21;
  376. toolBarButton21.ToolTipText = "医院分布";
  377. toolBarButton21.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton; 
  378. toolBarButton21.Pushed = true;
  379. ToolBarButton toolBarButton22 = new ToolBarButton();
  380. toolBarButton22.ImageIndex = 10;
  381. toolBarButton22.ToolTipText = "分布图";
  382. ToolBarButton toolBarButton23 = new ToolBarButton();
  383. toolBarButton23.ImageIndex = 10;
  384. toolBarButton23.ToolTipText = "分布图";
  385. ToolBarButton toolBarButton24 = new ToolBarButton();
  386. toolBarButton24.ImageIndex = 16;
  387. toolBarButton24.ToolTipText = "打印";
  388. ToolBarButton toolBarButton26 = new ToolBarButton();
  389. toolBarButton26.ImageIndex = 22;
  390. toolBarButton26.ToolTipText = "帮助";
  391. ToolBarButton toolBarButton25 = new ToolBarButton();
  392. toolBarButton25.ImageIndex = 17;
  393. toolBarButton25.ToolTipText = "退出";
  394. this._toolBar16.Buttons.Add(toolBarButton0);   
  395. this._toolBar16.Buttons.Add(toolBarButton1);   
  396. this._toolBar16.Buttons.Add(toolBarButton2);   
  397. this._toolBar16.Buttons.Add(toolBarButton3);   
  398. this._toolBar16.Buttons.Add(toolBarButton4);   
  399. this._toolBar16.Buttons.Add(toolBarButton0);  
  400. this._toolBar16.Buttons.Add(toolBarButton7);   
  401. this._toolBar16.Buttons.Add(toolBarButton8);   
  402. this._toolBar16.Buttons.Add(toolBarButton10);   
  403. this._toolBar16.Buttons.Add(toolBarButton11);
  404. this._toolBar16.Buttons.Add(toolBarButton0);
  405. this._toolBar16.Buttons.Add(toolBarButton30);   
  406. this._toolBar16.Buttons.Add(toolBarButton31);   
  407. this._toolBar16.Buttons.Add(toolBarButton32);   
  408. this._toolBar16.Buttons.Add(toolBarButton12);   
  409. this._toolBar16.Buttons.Add(toolBarButton13);   
  410. this._toolBar16.Buttons.Add(toolBarButton14);   
  411. this._toolBar16.Buttons.Add(toolBarButton15);   
  412. this._toolBar16.Buttons.Add(toolBarButton16);   
  413. this._toolBar16.Buttons.Add(toolBarButton17);   
  414. this._toolBar16.Buttons.Add(toolBarButton33);   
  415. this._toolBar16.Buttons.Add(toolBarButton0);
  416. this._toolBar16.Buttons.Add(toolBarButton24);   
  417. this._toolBar16.Buttons.Add(toolBarButton26);
  418. this._toolBar16.Buttons.Add(toolBarButton25);
  419. }
  420. //功能:Create Map OutlookBar
  421. //参数:无
  422. //返回值:void
  423. void CreateMapOutlookBar()
  424. {
  425. // 创建地图选项卡
  426. _mapOutlookBar = new OutlookBar();
  427. //地图集信息
  428. _tvMaps = new TreeView();
  429. _tvMaps.ImageList = _imagesMaps;
  430. LoadIndexInfos(_environment.m_nCurrMapIndex);
  431. LoadTreeView(TVType.TV_maps );
  432. _tvMaps.DoubleClick += new System.EventHandler(this._tvMaps_DoubleClick); 
  433. //图层集信息
  434. LoadLayerInfos(_environment.m_nCurrMapIndex);
  435. _tvLayers = new TreeView();
  436. _tvLayers.ImageList = _imagesVisible;
  437. LoadTreeView(TVType.TV_Layers );
  438. _tvLayers.AfterCheck += new TreeViewEventHandler(OnTreeViewItemChecked);
  439. // 加入树状列表
  440. _mapOutlookBar.Bands.Add(new OutlookBarBand("地图索引", _tvMaps));
  441. _mapOutlookBar.Bands.Add(new OutlookBarBand("地图控制", _tvLayers));
  442. _tvLegend = new TreeView(); 
  443. _mapOutlookBar.Bands.Add(new OutlookBarBand("图例", _tvLegend ));
  444. }
  445. /// ///////////////////////////////////////////////////////////////////////////////////////////////////
  446. //功能:图层控制,设置图层的可显示性
  447. //参数:
  448. //返回值:无
  449. /// //////////////////////////////////////////////////////////////////////////////////////////////////
  450. private void OnTreeViewItemChecked(object sender,TreeViewEventArgs e)
  451. {
  452. if (!_bTVChecked)
  453. return;
  454. int Level = GetNodeLevel(e.Node );
  455. if (e.Node.Checked)
  456. {
  457. //设置可显示
  458. switch (Level)
  459. {
  460. case 0:
  461. case 1:
  462. case 2:
  463. foreach(TreeNode node in e.Node.Nodes)
  464. {
  465. node.Checked =true;
  466. }
  467. break;
  468. case 3:
  469. {
  470. int nIndex = _environment.GetLayerIndexByName(e.Node.Text);
  471. if (nIndex >=0)
  472. {
  473. _environment.m_layerInfos[nIndex].bVisible = true;
  474. //判断是否在显示比例之内
  475. double dScale = _environment.CalcScale(_map);
  476. if (_environment.CalcScale(_map) <  _environment.m_layerInfos[nIndex].dShowScale)
  477. _environment.m_layerInfos[nIndex].layer.Visible = true;
  478. }
  479. }
  480. break;
  481. }
  482. }
  483. else
  484. {
  485. //设置不可显示
  486. switch (Level)
  487. {
  488. case 0:
  489. case 1:
  490. case 2:
  491. foreach(TreeNode node in e.Node.Nodes)
  492. {
  493. node.Checked =false;
  494. }
  495. break;
  496. case 3:
  497. {
  498. int nIndex = _environment.GetLayerIndexByName(e.Node.Text);
  499. if (nIndex >=0)
  500. {
  501. _environment.m_layerInfos[nIndex].layer.Visible = false;
  502. _environment.m_layerInfos[nIndex].bVisible = false;
  503. }
  504. }
  505. break;
  506. }
  507. }
  508. _environment.m_selectedFeature = null;
  509. _environment.m_drawLine = null;
  510. _environment.m_buses = null;
  511. _environment.ClearSelRsts();
  512. ReloadToolbar();
  513. _map.Extent = _map.Extent; 
  514. }
  515. private void LoadTreeView(TVType tvType)
  516. {
  517. switch (tvType)
  518. {
  519. case TVType.TV_maps: //地图索引
  520. _tvMaps.Nodes.Clear();
  521.   
  522. for (int i = 0; i < _environment.m_nMapNum; i ++  )
  523. {
  524. TreeNode mapNode = new TreeNode(_environment.m_mapInfos[i].szName,0,0);
  525. _tvMaps.Nodes.Add(mapNode);
  526. LoadIndexInfos(i);
  527. for (int j = 0; j < _environment.m_nIndexNum; j ++)
  528. {
  529. mapNode.Nodes.Add(new TreeNode(_environment.m_indexInfos[j].szName,0,0)); 
  530. }
  531. mapNode.Expand(); 
  532. }
  533.   
  534. LoadIndexInfos(_environment.m_nCurrMapIndex);
  535. break;
  536. case TVType.TV_Layers:
  537. _tvLayers.Nodes.Clear();
  538. _tvLayers.CheckBoxes = true;
  539.   
  540. TreeNode topNode = new TreeNode("北京市图层集",0,0);
  541. topNode.Checked = true;
  542. _tvLayers.Nodes.Add(topNode);
  543. //分4层
  544. System.Data.DataTable lyTypeTbl = this._environment.m_dataSet.Tables["地名类型"];
  545. System.Data.DataRow[] rowsType = lyTypeTbl.Select();
  546. foreach (System.Data.DataRow myRow in rowsType)
  547. {
  548. //加第1层
  549. TreeNode node = new TreeNode(myRow[0].ToString());
  550. node.Checked = true;
  551. //加第2层
  552. System.Data.DataTable subTypeTbl = this._environment.m_dataSet.Tables["地名中类型"];
  553. System.Data.DataRow[] rowsSubTypes = subTypeTbl.Select("大类='"+myRow[0].ToString()+"'");
  554. int []aIndex = new int[_environment.m_nLayerNum];
  555.   
  556. foreach (System.Data.DataRow myRow2 in rowsSubTypes)
  557. {
  558. string szSubType = myRow2["中类"].ToString();
  559. TreeNode node2 = new TreeNode(szSubType);
  560. node2.Checked = true;
  561. //加第3层
  562. int nCount = GetNodeArray2(aIndex,node.Text,szSubType);
  563. if (nCount > 0)
  564. {
  565. TreeNode[] nodes = new TreeNode[nCount];
  566. int count = 0;
  567. for (int j = 0; j < nCount; j ++)
  568. {
  569. nodes[j] = new TreeNode( _environment.m_layerInfos[aIndex[j]].szName);
  570. if (_environment.m_layerInfos[aIndex[j]].bVisible)
  571. nodes[j].Checked = true;
  572. else
  573. nodes[j].Checked  = false;
  574. if (_environment.m_layerInfos[aIndex[j]].bCanControl)
  575. {
  576. node2.Nodes.Add(nodes[j]);  
  577. count ++;
  578. }
  579. }
  580. if (0 == count)
  581. continue;
  582. }
  583. else
  584. {
  585. continue;
  586. }
  587. node.Nodes.Add(node2);  
  588. node.Expand(); 
  589. }
  590. if (node.Nodes != null && node.Nodes.Count > 0 )
  591. {
  592. topNode.Nodes.Add(node);
  593. topNode.Expand();
  594. }
  595. }
  596. break;
  597. case TVType.TV_Legend:
  598. {
  599. }
  600. break;
  601. default:
  602. break;
  603. }
  604. }
  605. private int GetNodeArray2(int []aIndex,string szType,string szSubType)
  606. {
  607. int nCount = 0;
  608. for (int i = 0; i < _environment.m_nLayerNum; i ++)
  609. {
  610. if (_environment.m_layerInfos[i].szType .Equals(szType) && _environment.m_layerInfos[i].szSubType.Equals(szSubType))
  611. {
  612. aIndex[nCount] = new int();
  613. aIndex[nCount] = i;
  614. nCount ++;
  615. }
  616. }
  617. return nCount;
  618. }
  619. /////////////////////////////////////////////////////////////////////////////
  620. //功能:创建工作区
  621. //参数:无
  622. //返回值:void
  623. protected void CreateWorkspace()
  624. {                     
  625. //创建地图选项卡
  626. CreateMapOutlookBar();
  627. //创建查询选项卡
  628. CreateQueryOutlookBar();
  629. // 设置两个选项卡
  630. _cIndexWnd = _manager.Contents.Add(_mapOutlookBar, "地图",_imagesWorkspace,2);
  631. _cQueryWnd = _manager.Contents.Add(_queryOutlookBar, "查询",_imagesWorkspace,1);
  632. _cIndexWnd.CloseButton = false;
  633. _cIndexWnd.HideButton =false;
  634. _cIndexWnd.DisplaySize = new Size(this.Width/5 ,this.Height * 3 /4); 
  635. _cIndexWnd.Control.Width =  this.Width/5;
  636. _cQueryWnd.CloseButton = false;
  637. _cQueryWnd.HideButton = false;
  638. this.SuspendLayout();
  639.       
  640. // 将地图选项卡放置在工作区的左边
  641. _wc = _manager.AddContentWithState(_cIndexWnd, State.DockRight) as WindowContent;
  642. _manager.AddContentToWindowContent(_cQueryWnd, _wc);    
  643.  
  644. _cQueryWnd.ParentWindowContent.ZoneArea = 125;  
  645. _mapEye = new AxMapObjects2.AxMap();
  646.                      
  647. _cEyeWnd = _manager.Contents.Add(_mapEye);
  648. _cEyeWnd.FullTitle = "缩略图";
  649. _cEyeWnd.CloseButton = false;
  650. _cEyeWnd.HideButton = false;
  651. _cEyeWnd.DisplaySize = new Size(this.Width/5 ,this.Height /4); 
  652. //2003.3.16
  653. this._mapEye.AfterLayerDraw += new AxMapObjects2._DMapEvents_AfterLayerDrawEventHandler(_mapEye_AfterLayerDraw);
  654. this._mapEye.MouseUpEvent += new AxMapObjects2._DMapEvents_MouseUpEventHandler(_mapEye_MouseUpEvent);
  655. _manager.AddContentToZone(_cEyeWnd, _wc.ParentZone , 1);
  656. _cEyeWnd.ParentWindowContent.ZoneArea = 25; 
  657.   
  658. this.ResumeLayout(); 
  659. }
  660. void CreateQueryOutlookBar()
  661. {
  662. // 创建查询选项卡
  663. _queryOutlookBar = new OutlookBar();
  664. // 在查询选项卡中加入面板控件
  665. _queryOutlookBar.Bands.Add(new OutlookBarBand("地名索引", this._panelIndex));
  666. _queryOutlookBar.Bands.Add(new OutlookBarBand("地名查询", this._panelQuery ));
  667. _queryOutlookBar.Bands.Add(new OutlookBarBand("查找最近", this._panelDist ));
  668. _queryOutlookBar.Bands.Add(new OutlookBarBand("公共交通查询", this._panelBus));
  669. InitIndexPanel();
  670. InitQueryPanel();
  671. InitDistPanel();
  672. InitBusPanel();
  673. //创建Output窗口
  674. _queryOutlookBar.Bands.Add(new OutlookBarBand("查询结果", this._panelOutput));
  675. }
  676. //2003.3.16
  677. private void _mapEye_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
  678. {
  679. if(e.index!=0)
  680. return;
  681. MapObjects2.Symbol sym = new MapObjects2.Symbol();
  682. sym.OutlineColor = (uint)MapObjects2.ColorConstants.moRed ;
  683. sym.Outline =true;
  684. sym.SymbolType = MapObjects2.SymbolTypeConstants.moFillSymbol;
  685. sym.Style = (short)MapObjects2.FillStyleConstants.moTransparentFill;
  686. _mapEye.DrawShape(_map.Extent,sym);
  687. }
  688. //2003.3.16
  689. private void _mapEye_MouseUpEvent(object sender, AxMapObjects2._DMapEvents_MouseUpEvent e)
  690. {
  691. MapObjects2.Symbol sym = new MapObjects2.Symbol();
  692. sym.OutlineColor = (uint)MapObjects2.ColorConstants.moRed ;
  693. sym.Outline =true;
  694. sym.SymbolType = MapObjects2.SymbolTypeConstants.moFillSymbol;
  695. sym.Style = (short)MapObjects2.FillStyleConstants.moTransparentFill;
  696. MapObjects2.Point point;
  697. point = _mapEye.ToMapPoint(e.x, e.y);
  698. _map.CenterAt(point.X,point.Y);
  699. _mapEye.Extent =_mapEye.Extent;
  700. }
  701. //Initialize 
  702. void Initialize()
  703. {
  704. _environment = new CEnvironment();
  705. _environment.m_szSDBPath = Application.StartupPath + "\电子地图\";
  706. _environment.m_szDBName = Application.StartupPath + "\地名数据库.mdb";
  707. _environment.m_AppPath  =Application.StartupPath;
  708. _environment.m_szHelpPath =Application.StartupPath + "\帮助\start.htm";
  709. }
  710. /// //////////////////////////////////////////////////////////////////////////////////////////
  711. //功能:Load Data
  712. //参数:void
  713. //返回值:void
  714. /// //////////////////////////////////////////////////////////////////////////////////////////
  715. void LoadData()
  716. {
  717. CreateDataSet();
  718. _environment.m_db = new MapObjects2.DataConnection();
  719. _environment.m_db.Database = _environment.m_szSDBPath; 
  720. }
  721. //Create DatabSet
  722. void CreateDataSet()
  723. {
  724. string strConnectionString;
  725. string strDatabasePath;
  726. //Create connection string
  727. strDatabasePath = Application.StartupPath;
  728. strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _environment.m_szDBName + 
  729. ";Persist Security Info=False";
  730. System.Data.OleDb.OleDbConnection  myConnection = new System.Data.OleDb.OleDbConnection(strConnectionString);   
  731. try
  732. {
  733. myConnection.Open();
  734. }
  735. catch(System.InvalidOperationException myException)
  736. {
  737. MessageBox.Show(
  738. "Message: " + myException.Message + "n" +
  739. "Source: " + myException.Source + "n"
  740. );
  741. }
  742. catch (System.Data.OleDb.OleDbException myException) 
  743. {
  744. for (int i=0; i < myException.Errors.Count; i++)
  745. {
  746. MessageBox.Show("Index #" + i + "n" +
  747. "Message: " + myException.Errors[i].Message + "n" +
  748. "Native: " + myException.Errors[i].NativeError.ToString() + "n" +
  749. "Source: " + myException.Errors[i].Source + "n" +
  750. "SQL: " + myException.Errors[i].SQLState + "n");
  751. }
  752. }
  753. //创建数据库
  754. //创建数据字典
  755. _environment.m_dataSet = new System.Data.DataSet("地名数据库");
  756. System.Data.OleDb.OleDbDataAdapter myDataAdapter = new System.Data.OleDb.OleDbDataAdapter("Select * From 地图集信息表",myConnection);
  757. myDataAdapter.Fill(_environment.m_dataSet,"地图集信息表");
  758. //创建地图集
  759. System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables["地图集信息表"];
  760. System.Data.DataRow[] rowsMaps = mapsTbl.Select();
  761. _environment.m_nMapNum = rowsMaps.Length;
  762. _environment.m_mapInfos = new MapInfo [_environment.m_nMapNum];
  763. int nIndex = 0;
  764. foreach (System.Data.DataRow myRow in rowsMaps)
  765. {
  766. string szTableName = myRow["表名"].ToString();
  767. if (szTableName != "")
  768. {
  769. _environment.m_mapInfos[nIndex].szName = myRow["名称"].ToString();
  770. _environment.m_mapInfos[nIndex].szMetaTable = szTableName;
  771. _environment.m_mapInfos[nIndex].szIndexTable = myRow["索引表名"].ToString();
  772. myDataAdapter.SelectCommand.CommandText = "Select * From " + szTableName + " Where 存在 = True Order By 显示次序1,显示次序2,id"; 
  773. myDataAdapter.Fill(_environment.m_dataSet,szTableName);
  774. if (_environment.m_mapInfos[nIndex].szIndexTable != "")
  775. {
  776. myDataAdapter.SelectCommand.CommandText = "Select * From " + _environment.m_mapInfos[nIndex].szIndexTable + " Order By id";
  777. myDataAdapter.Fill(_environment.m_dataSet,_environment.m_mapInfos[nIndex].szIndexTable);
  778. }
  779. _environment.m_mapInfos[nIndex].rect = new MapObjects2.Rectangle();
  780. _environment.m_mapInfos[nIndex].rect.Left = (double)myRow["X1"];
  781. _environment.m_mapInfos[nIndex].rect.Top = (double)myRow["Y1"];
  782. _environment.m_mapInfos[nIndex].rect.Right = (double)myRow["X2"];
  783. _environment.m_mapInfos[nIndex].rect.Bottom = (double)myRow["Y2"];
  784. nIndex ++;
  785. }
  786. }
  787. _environment.m_nCurrMapIndex = 0; 
  788. myDataAdapter.SelectCommand.CommandText  = "Select 大类 From 地名类型";
  789. myDataAdapter.Fill(_environment.m_dataSet,"地名类型"); 
  790. myDataAdapter.SelectCommand.CommandText  = "Select * From 地名中类型";
  791. myDataAdapter.Fill(_environment.m_dataSet,"地名中类型"); 
  792. myDataAdapter.SelectCommand.CommandText  = "Select * From 地名索引";
  793. myDataAdapter.Fill(_environment.m_dataSet,"地名索引"); 
  794. myDataAdapter.SelectCommand.CommandText  = "Select distinct 线路名 From 公交车站路线 Order By 线路名";
  795. myDataAdapter.Fill(_environment.m_dataSet,"公交线路"); 
  796. myDataAdapter.SelectCommand.CommandText  = "Select distinct 站名 From 公交车站路线 Order By 站名";
  797. myDataAdapter.Fill(_environment.m_dataSet,"公交车站"); 
  798. myDataAdapter.SelectCommand.CommandText  = "Select * From 公交车站";
  799. myDataAdapter.Fill(_environment.m_dataSet,"公交车站2"); 
  800. myDataAdapter.SelectCommand.CommandText  = "Select * From 公交车站路线 Order By 线路名";
  801. myDataAdapter.Fill(_environment.m_dataSet,"公交车站路线"); 
  802. myDataAdapter.SelectCommand.CommandText  = "Select * From AAT Order By ARCID";
  803. myDataAdapter.Fill(_environment.m_dataSet,"AAT"); 
  804. myDataAdapter.SelectCommand.CommandText  = "Select * From NAT Order By NODEID";
  805. myDataAdapter.Fill(_environment.m_dataSet,"NAT"); 
  806. myConnection.Close(); 
  807. }
  808. //装载索引信息
  809. void LoadIndexInfos(int nIndex)
  810. {
  811. string szIndexTable = _environment.m_mapInfos[nIndex].szIndexTable;
  812.    
  813. System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szIndexTable];
  814. System.Data.DataRow[] rowsMaps = mapsTbl.Select();
  815. _environment.m_nIndexNum = rowsMaps.Length;
  816. _environment.m_indexInfos  = null;
  817. _environment.m_indexInfos  = new IndexInfo[_environment.m_nIndexNum]; 
  818. int nIdx = 0;
  819. foreach (System.Data.DataRow myRow in rowsMaps)
  820. {
  821. _environment.m_indexInfos[nIdx].szName = myRow["名称"].ToString();
  822. // _environment.m_indexInfos[nIdx].dX  = (double)myRow["X坐标"]; 
  823. // _environment.m_indexInfos[nIdx].dY  = (double)myRow["Y坐标"]; 
  824. _environment.m_indexInfos[nIdx].m_extent = new MapObjects2.Rectangle();
  825. _environment.m_indexInfos[nIdx].m_extent.Top = (double)myRow["Y1"]; 
  826. _environment.m_indexInfos[nIdx].m_extent.Bottom  = (double)myRow["Y2"]; 
  827. _environment.m_indexInfos[nIdx].m_extent.Right  = (double)myRow["X2"]; 
  828. _environment.m_indexInfos[nIdx].m_extent.Left  = (double)myRow["X1"]; 
  829. nIdx ++;
  830. }
  831. }
  832. //装载图层信息
  833. void LoadLayerInfos(int nIndex)
  834. {
  835. string szMetaTable = _environment.m_mapInfos[nIndex].szMetaTable;
  836.    
  837. System.Data.DataTable mapsTbl = this._environment.m_dataSet.Tables[szMetaTable];
  838. System.Data.DataRow[] rowsMaps = mapsTbl.Select("存在=true","显示次序1,显示次序2,id");
  839. _environment.m_nLayerNum = rowsMaps.Length;
  840. _environment.m_layerInfos = null;
  841. _environment.m_layerInfos = new LayerInfo[_environment.m_nLayerNum]; 
  842. int nIdx = 0;
  843. foreach (System.Data.DataRow myRow in rowsMaps)
  844. {
  845. _environment.m_layerInfos[nIdx].szName = myRow["名称"].ToString(); 
  846. _environment.m_layerInfos[nIdx].szType  = myRow["大类"].ToString(); 
  847. _environment.m_layerInfos[nIdx].szFileName  = myRow["图形文件"].ToString(); 
  848. _environment.m_layerInfos[nIdx].szSubType = myRow["中类"].ToString(); 
  849. _environment.m_layerInfos[nIdx].szTableName  = myRow["属性表名"].ToString(); 
  850. _environment.m_layerInfos[nIdx].szLayerName  = myRow["图层名"].ToString(); 
  851. _environment.m_layerInfos[nIdx].bVisible  = (bool)myRow["显示"]; 
  852. _environment.m_layerInfos[nIdx].bLable   = (bool)myRow["注记"]; 
  853. _environment.m_layerInfos[nIdx].bCanSelected   = (bool)myRow["选择"]; 
  854. _environment.m_layerInfos[nIdx].bCanControl    = (bool)myRow["控制"]; 
  855. _environment.m_layerInfos[nIdx].bBackground     = (bool)myRow["地物"]; 
  856. if (myRow["小类"] != System.DBNull.Value)
  857. _environment.m_layerInfos[nIdx].szSubType2 = myRow["小类"].ToString();
  858. else
  859. _environment.m_layerInfos[nIdx].szSubType2 = "";
  860. if (myRow["次小类"] != System.DBNull.Value)
  861. _environment.m_layerInfos[nIdx].szSubType3 = myRow["次小类"].ToString();
  862. else
  863. _environment.m_layerInfos[nIdx].szSubType3 = "";
  864. if (myRow["注记比例尺"] != System.DBNull.Value)
  865. _environment.m_layerInfos[nIdx].dScale = (double)myRow["注记比例尺"];
  866. else
  867. _environment.m_layerInfos[nIdx].dScale = 999999999;
  868. if (myRow["显示比例尺"] != System.DBNull.Value)
  869. _environment.m_layerInfos[nIdx].dShowScale = (double)myRow["显示比例尺"];
  870. else
  871. _environment.m_layerInfos[nIdx].dShowScale = 999999999;
  872. if (myRow["符号索引"] != System.DBNull.Value)
  873. _environment.m_layerInfos[nIdx].nCharacterIndex = (int)myRow["符号索引"];
  874. else
  875. _environment.m_layerInfos[nIdx].nCharacterIndex = -1;
  876. if (myRow["注记大小"] != System.DBNull.Value)
  877. _environment.m_layerInfos[nIdx].nFontSize = (int)myRow["注记大小"];
  878. else
  879. _environment.m_layerInfos[nIdx].nFontSize = 10;
  880. if (myRow["字体名称"] != System.DBNull.Value)
  881. _environment.m_layerInfos[nIdx].szFontName = myRow["字体名称"].ToString() ;
  882. else
  883. _environment.m_layerInfos[nIdx].szFontName = "";
  884. if (myRow["符号大小"] != System.DBNull.Value)
  885. _environment.m_layerInfos[nIdx].nSymSize = (int)myRow["符号大小"];
  886. else
  887. _environment.m_layerInfos[nIdx].nSymSize = 4;
  888. if (myRow["符号颜色"] != System.DBNull.Value)
  889. {
  890. int nColor = (int)myRow["符号颜色"];
  891. _environment.m_layerInfos[nIdx].nSymColor = (uint)nColor;//;
  892. }
  893. else
  894. {
  895. _environment.m_layerInfos[nIdx].nSymColor = CEnvironment.SYMBOL_COLOR_NONE;
  896. }
  897. if (myRow["字段名"] != System.DBNull.Value)
  898. _environment.m_layerInfos[nIdx].szFieldName = myRow["字段名"].ToString();
  899. else
  900. _environment.m_layerInfos[nIdx].szFieldName = "单位名称";
  901. if (_environment.m_layerInfos[nIdx].szLayerName.Equals("公交车站"))
  902. {
  903. _environment.m_szfntStation  =  _environment.m_layerInfos[nIdx].szFontName;
  904. _environment.m_chStation = (char)_environment.m_layerInfos[nIdx].nCharacterIndex; 
  905. _environment.m_nfntStation  = _environment.m_layerInfos[nIdx].nFontSize; 
  906. }
  907. nIdx ++;
  908. }
  909. }
  910. /// <summary>
  911. /// Clean up any resources being used.
  912. /// </summary>
  913. protected override void Dispose( bool disposing )
  914. {
  915. if( disposing )
  916. {
  917. if (components != null) 
  918. {
  919. components.Dispose();
  920. }
  921. }
  922. base.Dispose( disposing );
  923. }
  924. #region Windows Form Designer generated code
  925. /// <summary>
  926. /// Required method for Designer support - do not modify
  927. /// the contents of this method with the code editor.
  928. /// </summary>
  929. private void InitializeComponent()
  930. {
  931. this.components = new System.ComponentModel.Container();
  932. System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmMain));
  933. this._comboBox = new System.Windows.Forms.ComboBox();
  934. this._panelBus = new System.Windows.Forms.Panel();
  935. this._bus_checkBox7 = new System.Windows.Forms.CheckBox();
  936. this._bus_checkBox6 = new System.Windows.Forms.CheckBox();
  937. this._bus_checkBox5 = new System.Windows.Forms.CheckBox();
  938. this._bus_checkBox4 = new System.Windows.Forms.CheckBox();
  939. this._bus_checkBox3 = new System.Windows.Forms.CheckBox();
  940. this._bus_checkBox2 = new System.Windows.Forms.CheckBox();
  941. this._bus_checkBox1 = new System.Windows.Forms.CheckBox();
  942. this._bus_button = new System.Windows.Forms.Button();
  943. this._Bus_listBox = new System.Windows.Forms.ListBox();
  944. this._Bus_radioButton_Line = new System.Windows.Forms.RadioButton();
  945. this._Bus_radioButton_Station = new System.Windows.Forms.RadioButton();
  946. this._Bus_textBox = new System.Windows.Forms.TextBox();
  947. this._panelDist = new System.Windows.Forms.Panel();
  948. this._dis_label_Note = new System.Windows.Forms.Label();
  949. this._dist_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
  950. this._dist_comboBoxFilter = new System.Windows.Forms.ComboBox();
  951. this._dist_button = new System.Windows.Forms.Button();
  952. this._dist_radioButton2 = new System.Windows.Forms.RadioButton();
  953. this._dist_radioButton1 = new System.Windows.Forms.RadioButton();
  954. this._dist_comboBoxPos = new System.Windows.Forms.ComboBox();
  955. this._dist_label1 = new System.Windows.Forms.Label();
  956. this._dist_txtName = new System.Windows.Forms.TextBox();
  957. this._panelIndex = new System.Windows.Forms.Panel();
  958. this._index_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
  959. this._index_listBox = new System.Windows.Forms.ListBox();
  960. this._index_comboBoxFilter = new System.Windows.Forms.ComboBox();
  961. this._index_txtName = new System.Windows.Forms.TextBox();
  962. this._index_label2 = new System.Windows.Forms.Label();
  963. this._index_label1 = new System.Windows.Forms.Label();
  964. this._panelOutput = new System.Windows.Forms.Panel();
  965. this._output_button3 = new System.Windows.Forms.Button();
  966. this._output_button2 = new System.Windows.Forms.Button();
  967. this._output_button1 = new System.Windows.Forms.Button();
  968. this._output_listBox = new System.Windows.Forms.ListBox();
  969. this._Output_label = new System.Windows.Forms.Label();
  970. this._panelQuery = new System.Windows.Forms.Panel();
  971. this._query_comboBoxFilter2 = new System.Windows.Forms.ComboBox();
  972. this._query_button = new System.Windows.Forms.Button();
  973. this._query_checkBox3 = new System.Windows.Forms.CheckBox();
  974. this._query_checkBox2 = new System.Windows.Forms.CheckBox();
  975. this._query_checkBox1 = new System.Windows.Forms.CheckBox();
  976. this._query_comboBoxFilter = new System.Windows.Forms.ComboBox();
  977. this._query_txtTel = new System.Windows.Forms.TextBox();
  978. this._query_txtName = new System.Windows.Forms.TextBox();
  979. this._query_label3 = new System.Windows.Forms.Label();
  980. this._query_label2 = new System.Windows.Forms.Label();
  981. this._query_label1 = new System.Windows.Forms.Label();
  982. this._timer = new System.Windows.Forms.Timer(this.components);
  983. this._toolBar16 = new System.Windows.Forms.ToolBar();
  984. this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
  985. this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
  986. this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
  987. this.statusBarPanel4 = new System.Windows.Forms.StatusBarPanel();
  988. this._statusBar = new System.Windows.Forms.StatusBar();
  989. this._toolBar2 = new System.Windows.Forms.ToolBar();
  990. this._map = new AxMapObjects2.AxMap();
  991. this._picToolTip = new System.Windows.Forms.PictureBox();
  992. this._lblToolTip = new System.Windows.Forms.Label();
  993. this._panelBus.SuspendLayout();
  994. this._panelDist.SuspendLayout();
  995. this._panelIndex.SuspendLayout();
  996. this._panelOutput.SuspendLayout();
  997. this._panelQuery.SuspendLayout();
  998. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
  999. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
  1000. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
  1001. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).BeginInit();
  1002. ((System.ComponentModel.ISupportInitialize)(this._map)).BeginInit();
  1003. this.SuspendLayout();
  1004. // 
  1005. // _comboBox
  1006. // 
  1007. this._comboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1008. this._comboBox.Items.AddRange(new object[] {
  1009.    "100%",
  1010.    "200%",
  1011.    "400%",
  1012.    "800%",
  1013.    "1600%"});
  1014. this._comboBox.Location = new System.Drawing.Point(504, 472);
  1015. this._comboBox.Name = "_comboBox";
  1016. this._comboBox.Size = new System.Drawing.Size(96, 20);
  1017. this._comboBox.TabIndex = 7;
  1018. this._comboBox.SelectionChangeCommitted += new System.EventHandler(this._comboBox_SelectionChangeCommitted_1);
  1019. // 
  1020. // _panelBus
  1021. // 
  1022. this._panelBus.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1023. | System.Windows.Forms.AnchorStyles.Left);
  1024. this._panelBus.Controls.AddRange(new System.Windows.Forms.Control[] {
  1025. this._bus_checkBox7,
  1026. this._bus_checkBox6,
  1027. this._bus_checkBox5,
  1028. this._bus_checkBox4,
  1029. this._bus_checkBox3,
  1030. this._bus_checkBox2,
  1031. this._bus_checkBox1,
  1032. this._bus_button,
  1033. this._Bus_listBox,
  1034. this._Bus_radioButton_Line,
  1035. this._Bus_radioButton_Station,
  1036. this._Bus_textBox});
  1037. this._panelBus.Location = new System.Drawing.Point(248, 91);
  1038. this._panelBus.Name = "_panelBus";
  1039. this._panelBus.Size = new System.Drawing.Size(208, 317);
  1040. this._panelBus.TabIndex = 9;
  1041. this._panelBus.Visible = false;
  1042. // 
  1043. // _bus_checkBox7
  1044. // 
  1045. this._bus_checkBox7.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1046. this._bus_checkBox7.Checked = true;
  1047. this._bus_checkBox7.CheckState = System.Windows.Forms.CheckState.Checked;
  1048. this._bus_checkBox7.Location = new System.Drawing.Point(8, 264);
  1049. this._bus_checkBox7.Name = "_bus_checkBox7";
  1050. this._bus_checkBox7.Size = new System.Drawing.Size(64, 24);
  1051. this._bus_checkBox7.TabIndex = 27;
  1052. this._bus_checkBox7.Text = "地铁";
  1053. this._bus_checkBox7.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1054. // 
  1055. // _bus_checkBox6
  1056. // 
  1057. this._bus_checkBox6.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1058. this._bus_checkBox6.Checked = true;
  1059. this._bus_checkBox6.CheckState = System.Windows.Forms.CheckState.Checked;
  1060. this._bus_checkBox6.Location = new System.Drawing.Point(136, 240);
  1061. this._bus_checkBox6.Name = "_bus_checkBox6";
  1062. this._bus_checkBox6.Size = new System.Drawing.Size(64, 24);
  1063. this._bus_checkBox6.TabIndex = 26;
  1064. this._bus_checkBox6.Text = "夜班车";
  1065. this._bus_checkBox6.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1066. // 
  1067. // _bus_checkBox5
  1068. // 
  1069. this._bus_checkBox5.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1070. this._bus_checkBox5.Checked = true;
  1071. this._bus_checkBox5.CheckState = System.Windows.Forms.CheckState.Checked;
  1072. this._bus_checkBox5.Location = new System.Drawing.Point(136, 216);
  1073. this._bus_checkBox5.Name = "_bus_checkBox5";
  1074. this._bus_checkBox5.Size = new System.Drawing.Size(64, 24);
  1075. this._bus_checkBox5.TabIndex = 25;
  1076. this._bus_checkBox5.Text = "长途车";
  1077. this._bus_checkBox5.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1078. // 
  1079. // _bus_checkBox4
  1080. // 
  1081. this._bus_checkBox4.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1082. this._bus_checkBox4.Checked = true;
  1083. this._bus_checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
  1084. this._bus_checkBox4.Location = new System.Drawing.Point(64, 240);
  1085. this._bus_checkBox4.Name = "_bus_checkBox4";
  1086. this._bus_checkBox4.Size = new System.Drawing.Size(88, 24);
  1087. this._bus_checkBox4.TabIndex = 24;
  1088. this._bus_checkBox4.Text = "巴士专线";
  1089. this._bus_checkBox4.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1090. // 
  1091. // _bus_checkBox3
  1092. // 
  1093. this._bus_checkBox3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1094. this._bus_checkBox3.Checked = true;
  1095. this._bus_checkBox3.CheckState = System.Windows.Forms.CheckState.Checked;
  1096. this._bus_checkBox3.Location = new System.Drawing.Point(64, 216);
  1097. this._bus_checkBox3.Name = "_bus_checkBox3";
  1098. this._bus_checkBox3.Size = new System.Drawing.Size(88, 24);
  1099. this._bus_checkBox3.TabIndex = 23;
  1100. this._bus_checkBox3.Text = "运通专线";
  1101. this._bus_checkBox3.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1102. // 
  1103. // _bus_checkBox2
  1104. // 
  1105. this._bus_checkBox2.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1106. this._bus_checkBox2.Checked = true;
  1107. this._bus_checkBox2.CheckState = System.Windows.Forms.CheckState.Checked;
  1108. this._bus_checkBox2.Location = new System.Drawing.Point(8, 240);
  1109. this._bus_checkBox2.Name = "_bus_checkBox2";
  1110. this._bus_checkBox2.Size = new System.Drawing.Size(64, 24);
  1111. this._bus_checkBox2.TabIndex = 22;
  1112. this._bus_checkBox2.Text = "郊区车";
  1113. this._bus_checkBox2.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1114. // 
  1115. // _bus_checkBox1
  1116. // 
  1117. this._bus_checkBox1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1118. this._bus_checkBox1.Checked = true;
  1119. this._bus_checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
  1120. this._bus_checkBox1.Location = new System.Drawing.Point(8, 216);
  1121. this._bus_checkBox1.Name = "_bus_checkBox1";
  1122. this._bus_checkBox1.Size = new System.Drawing.Size(64, 24);
  1123. this._bus_checkBox1.TabIndex = 21;
  1124. this._bus_checkBox1.Text = "市区车";
  1125. this._bus_checkBox1.CheckedChanged += new System.EventHandler(this._bus_checkBox1_CheckedChanged);
  1126. // 
  1127. // _bus_button
  1128. // 
  1129. this._bus_button.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
  1130. | System.Windows.Forms.AnchorStyles.Right);
  1131. this._bus_button.Location = new System.Drawing.Point(8, 288);
  1132. this._bus_button.Name = "_bus_button";
  1133. this._bus_button.Size = new System.Drawing.Size(192, 24);
  1134. this._bus_button.TabIndex = 6;
  1135. this._bus_button.Text = "选择乘车路线";
  1136. this._bus_button.Click += new System.EventHandler(this._bus_button_Click);
  1137. // 
  1138. // _Bus_listBox
  1139. // 
  1140. this._Bus_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1141. | System.Windows.Forms.AnchorStyles.Left) 
  1142. | System.Windows.Forms.AnchorStyles.Right);
  1143. this._Bus_listBox.ItemHeight = 12;
  1144. this._Bus_listBox.Location = new System.Drawing.Point(8, 56);
  1145. this._Bus_listBox.Name = "_Bus_listBox";
  1146. this._Bus_listBox.Size = new System.Drawing.Size(192, 160);
  1147. this._Bus_listBox.TabIndex = 5;
  1148. this._Bus_listBox.DoubleClick += new System.EventHandler(this._Bus_listBox_DoubleClick);
  1149. this._Bus_listBox.SelectedValueChanged += new System.EventHandler(this._Bus_listBox_SelectedValueChanged);
  1150. // 
  1151. // _Bus_radioButton_Line
  1152. // 
  1153. this._Bus_radioButton_Line.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1154. | System.Windows.Forms.AnchorStyles.Right);
  1155. this._Bus_radioButton_Line.Location = new System.Drawing.Point(104, 32);
  1156. this._Bus_radioButton_Line.Name = "_Bus_radioButton_Line";
  1157. this._Bus_radioButton_Line.Size = new System.Drawing.Size(112, 24);
  1158. this._Bus_radioButton_Line.TabIndex = 4;
  1159. this._Bus_radioButton_Line.Text = "公交路线";
  1160. // 
  1161. // _Bus_radioButton_Station
  1162. // 
  1163. this._Bus_radioButton_Station.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1164. | System.Windows.Forms.AnchorStyles.Right);
  1165. this._Bus_radioButton_Station.Checked = true;
  1166. this._Bus_radioButton_Station.Location = new System.Drawing.Point(8, 32);
  1167. this._Bus_radioButton_Station.Name = "_Bus_radioButton_Station";
  1168. this._Bus_radioButton_Station.Size = new System.Drawing.Size(120, 24);
  1169. this._Bus_radioButton_Station.TabIndex = 3;
  1170. this._Bus_radioButton_Station.TabStop = true;
  1171. this._Bus_radioButton_Station.Text = "公交车站";
  1172. this._Bus_radioButton_Station.CheckedChanged += new System.EventHandler(this._Bus_radioButton_Station_CheckedChanged);
  1173. // 
  1174. // _Bus_textBox
  1175. // 
  1176. this._Bus_textBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1177. | System.Windows.Forms.AnchorStyles.Right);
  1178. this._Bus_textBox.Location = new System.Drawing.Point(8, 8);
  1179. this._Bus_textBox.Name = "_Bus_textBox";
  1180. this._Bus_textBox.Size = new System.Drawing.Size(192, 21);
  1181. this._Bus_textBox.TabIndex = 2;
  1182. this._Bus_textBox.Text = "";
  1183. this._Bus_textBox.TextChanged += new System.EventHandler(this._Bus_textBox_TextChanged);
  1184. // 
  1185. // _panelDist
  1186. // 
  1187. this._panelDist.Controls.AddRange(new System.Windows.Forms.Control[] {
  1188.  this._dis_label_Note,
  1189.  this._dist_comboBoxFilter2,
  1190.  this._dist_comboBoxFilter,
  1191.  this._dist_button,
  1192.  this._dist_radioButton2,
  1193.  this._dist_radioButton1,
  1194.  this._dist_comboBoxPos,
  1195.  this._dist_label1,
  1196.  this._dist_txtName});
  1197. this._panelDist.Location = new System.Drawing.Point(264, 128);
  1198. this._panelDist.Name = "_panelDist";
  1199. this._panelDist.Size = new System.Drawing.Size(208, 349);
  1200. this._panelDist.TabIndex = 10;
  1201. this._panelDist.Visible = false;
  1202. // 
  1203. // _dis_label_Note
  1204. // 
  1205. this._dis_label_Note.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  1206. this._dis_label_Note.Location = new System.Drawing.Point(8, 224);
  1207. this._dis_label_Note.Name = "_dis_label_Note";
  1208. this._dis_label_Note.Size = new System.Drawing.Size(192, 80);
  1209. this._dis_label_Note.TabIndex = 22;
  1210. this._dis_label_Note.Text = "    按位置查找时,选择了距离和过滤类型后,先按"搜索"按钮,然后将鼠标移动到地图上选择你所要查询的位置。";
  1211. // 
  1212. // _dist_comboBoxFilter2
  1213. // 
  1214. this._dist_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1215. | System.Windows.Forms.AnchorStyles.Right);
  1216. this._dist_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1217. this._dist_comboBoxFilter2.Location = new System.Drawing.Point(8, 152);
  1218. this._dist_comboBoxFilter2.Name = "_dist_comboBoxFilter2";
  1219. this._dist_comboBoxFilter2.Size = new System.Drawing.Size(192, 20);
  1220. this._dist_comboBoxFilter2.TabIndex = 21;
  1221. // 
  1222. // _dist_comboBoxFilter
  1223. // 
  1224. this._dist_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1225. | System.Windows.Forms.AnchorStyles.Right);
  1226. this._dist_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1227. this._dist_comboBoxFilter.Location = new System.Drawing.Point(8, 120);
  1228. this._dist_comboBoxFilter.Name = "_dist_comboBoxFilter";
  1229. this._dist_comboBoxFilter.Size = new System.Drawing.Size(192, 20);
  1230. this._dist_comboBoxFilter.TabIndex = 20;
  1231. this._dist_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._dist_comboBoxFilter_SelectedIndexChanged);
  1232. // 
  1233. // _dist_button
  1234. // 
  1235. this._dist_button.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  1236. this._dist_button.Location = new System.Drawing.Point(8, 184);
  1237. this._dist_button.Name = "_dist_button";
  1238. this._dist_button.Size = new System.Drawing.Size(72, 24);
  1239. this._dist_button.TabIndex = 19;
  1240. this._dist_button.Text = "搜索";
  1241. this._dist_button.Click += new System.EventHandler(this._dist_button_Click);
  1242. // 
  1243. // _dist_radioButton2
  1244. // 
  1245. this._dist_radioButton2.Checked = true;
  1246. this._dist_radioButton2.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  1247. this._dist_radioButton2.Location = new System.Drawing.Point(8, 8);
  1248. this._dist_radioButton2.Name = "_dist_radioButton2";
  1249. this._dist_radioButton2.TabIndex = 18;
  1250. this._dist_radioButton2.TabStop = true;
  1251. this._dist_radioButton2.Text = "按位置查找";
  1252. this._dist_radioButton2.CheckedChanged += new System.EventHandler(this._dist_radioButton2_CheckedChanged);
  1253. // 
  1254. // _dist_radioButton1
  1255. // 
  1256. this._dist_radioButton1.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  1257. this._dist_radioButton1.Location = new System.Drawing.Point(8, 32);
  1258. this._dist_radioButton1.Name = "_dist_radioButton1";
  1259. this._dist_radioButton1.TabIndex = 17;
  1260. this._dist_radioButton1.Text = "按地名查找";
  1261. this._dist_radioButton1.CheckedChanged += new System.EventHandler(this._dist_radioButton1_CheckedChanged);
  1262. // 
  1263. // _dist_comboBoxPos
  1264. // 
  1265. this._dist_comboBoxPos.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1266. | System.Windows.Forms.AnchorStyles.Right);
  1267. this._dist_comboBoxPos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1268. this._dist_comboBoxPos.Items.AddRange(new object[] {
  1269.    "最近的",
  1270.    "10米",
  1271.    "20米",
  1272.    "50米",
  1273.    "100米",
  1274.    "200米",
  1275.    "500米",
  1276.    "1000米"});
  1277. this._dist_comboBoxPos.Location = new System.Drawing.Point(48, 88);
  1278. this._dist_comboBoxPos.Name = "_dist_comboBoxPos";
  1279. this._dist_comboBoxPos.Size = new System.Drawing.Size(152, 20);
  1280. this._dist_comboBoxPos.TabIndex = 16;
  1281. // 
  1282. // _dist_label1
  1283. // 
  1284. this._dist_label1.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
  1285. this._dist_label1.Location = new System.Drawing.Point(8, 88);
  1286. this._dist_label1.Name = "_dist_label1";
  1287. this._dist_label1.Size = new System.Drawing.Size(32, 24);
  1288. this._dist_label1.TabIndex = 15;
  1289. this._dist_label1.Text = "距离";
  1290. // 
  1291. // _dist_txtName
  1292. // 
  1293. this._dist_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1294. | System.Windows.Forms.AnchorStyles.Right);
  1295. this._dist_txtName.Enabled = false;
  1296. this._dist_txtName.Location = new System.Drawing.Point(8, 56);
  1297. this._dist_txtName.Name = "_dist_txtName";
  1298. this._dist_txtName.Size = new System.Drawing.Size(192, 21);
  1299. this._dist_txtName.TabIndex = 14;
  1300. this._dist_txtName.Text = "";
  1301. // 
  1302. // _panelIndex
  1303. // 
  1304. this._panelIndex.Controls.AddRange(new System.Windows.Forms.Control[] {
  1305.   this._index_comboBoxFilter2,
  1306.   this._index_listBox,
  1307.   this._index_comboBoxFilter,
  1308.   this._index_txtName,
  1309.   this._index_label2,
  1310.   this._index_label1});
  1311. this._panelIndex.Location = new System.Drawing.Point(244, 83);
  1312. this._panelIndex.Name = "_panelIndex";
  1313. this._panelIndex.Size = new System.Drawing.Size(216, 328);
  1314. this._panelIndex.TabIndex = 11;
  1315. this._panelIndex.Visible = false;
  1316. // 
  1317. // _index_comboBoxFilter2
  1318. // 
  1319. this._index_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1320. | System.Windows.Forms.AnchorStyles.Right);
  1321. this._index_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1322. this._index_comboBoxFilter2.Location = new System.Drawing.Point(8, 104);
  1323. this._index_comboBoxFilter2.Name = "_index_comboBoxFilter2";
  1324. this._index_comboBoxFilter2.Size = new System.Drawing.Size(200, 20);
  1325. this._index_comboBoxFilter2.TabIndex = 13;
  1326. this._index_comboBoxFilter2.SelectedIndexChanged += new System.EventHandler(this._index_comboBoxFilter2_SelectedIndexChanged);
  1327. // 
  1328. // _index_listBox
  1329. // 
  1330. this._index_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1331. | System.Windows.Forms.AnchorStyles.Left) 
  1332. | System.Windows.Forms.AnchorStyles.Right);
  1333. this._index_listBox.ItemHeight = 12;
  1334. this._index_listBox.Location = new System.Drawing.Point(8, 136);
  1335. this._index_listBox.Name = "_index_listBox";
  1336. this._index_listBox.Size = new System.Drawing.Size(200, 184);
  1337. this._index_listBox.TabIndex = 12;
  1338. this._index_listBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this._index_listBox_MouseDown);
  1339. this._index_listBox.DoubleClick += new System.EventHandler(this._index_listBox_DoubleClick);
  1340. this._index_listBox.SelectedIndexChanged += new System.EventHandler(this._index_listBox_SelectedIndexChanged);
  1341. // 
  1342. // _index_comboBoxFilter
  1343. // 
  1344. this._index_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1345. | System.Windows.Forms.AnchorStyles.Right);
  1346. this._index_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1347. this._index_comboBoxFilter.Location = new System.Drawing.Point(8, 72);
  1348. this._index_comboBoxFilter.Name = "_index_comboBoxFilter";
  1349. this._index_comboBoxFilter.Size = new System.Drawing.Size(200, 20);
  1350. this._index_comboBoxFilter.TabIndex = 11;
  1351. this._index_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._index_comboBoxFilter_SelectedIndexChanged);
  1352. // 
  1353. // _index_txtName
  1354. // 
  1355. this._index_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1356. | System.Windows.Forms.AnchorStyles.Right);
  1357. this._index_txtName.Location = new System.Drawing.Point(8, 24);
  1358. this._index_txtName.Name = "_index_txtName";
  1359. this._index_txtName.Size = new System.Drawing.Size(200, 21);
  1360. this._index_txtName.TabIndex = 10;
  1361. this._index_txtName.Text = "";
  1362. this._index_txtName.TextChanged += new System.EventHandler(this._index_txtName_TextChanged);
  1363. // 
  1364. // _index_label2
  1365. // 
  1366. this._index_label2.Location = new System.Drawing.Point(8, 56);
  1367. this._index_label2.Name = "_index_label2";
  1368. this._index_label2.Size = new System.Drawing.Size(72, 16);
  1369. this._index_label2.TabIndex = 9;
  1370. this._index_label2.Text = "地名分类:";
  1371. // 
  1372. // _index_label1
  1373. // 
  1374. this._index_label1.Location = new System.Drawing.Point(8, 8);
  1375. this._index_label1.Name = "_index_label1";
  1376. this._index_label1.Size = new System.Drawing.Size(72, 16);
  1377. this._index_label1.TabIndex = 8;
  1378. this._index_label1.Text = "地名名称:";
  1379. // 
  1380. // _panelOutput
  1381. // 
  1382. this._panelOutput.Controls.AddRange(new System.Windows.Forms.Control[] {
  1383.    this._output_button3,
  1384.    this._output_button2,
  1385.    this._output_button1,
  1386.    this._output_listBox,
  1387.    this._Output_label});
  1388. this._panelOutput.Location = new System.Drawing.Point(240, 89);
  1389. this._panelOutput.Name = "_panelOutput";
  1390. this._panelOutput.Size = new System.Drawing.Size(224, 317);
  1391. this._panelOutput.TabIndex = 12;
  1392. this._panelOutput.Visible = false;
  1393. // 
  1394. // _output_button3
  1395. // 
  1396. this._output_button3.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1397. this._output_button3.Enabled = false;
  1398. this._output_button3.ImageIndex = 0;
  1399. this._output_button3.Location = new System.Drawing.Point(124, 282);
  1400. this._output_button3.Name = "_output_button3";
  1401. this._output_button3.Size = new System.Drawing.Size(56, 24);
  1402. this._output_button3.TabIndex = 9;
  1403. this._output_button3.Tag = "";
  1404. this._output_button3.Text = "定位";
  1405. this._output_button3.Click += new System.EventHandler(this._output_button3_Click);
  1406. // 
  1407. // _output_button2
  1408. // 
  1409. this._output_button2.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1410. this._output_button2.Enabled = false;
  1411. this._output_button2.ImageIndex = 0;
  1412. this._output_button2.Location = new System.Drawing.Point(68, 282);
  1413. this._output_button2.Name = "_output_button2";
  1414. this._output_button2.Size = new System.Drawing.Size(56, 24);
  1415. this._output_button2.TabIndex = 8;
  1416. this._output_button2.Tag = "";
  1417. this._output_button2.Text = "多媒体";
  1418. // 
  1419. // _output_button1
  1420. // 
  1421. this._output_button1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
  1422. this._output_button1.Enabled = false;
  1423. this._output_button1.ImageIndex = 0;
  1424. this._output_button1.Location = new System.Drawing.Point(12, 282);
  1425. this._output_button1.Name = "_output_button1";
  1426. this._output_button1.Size = new System.Drawing.Size(56, 24);
  1427. this._output_button1.TabIndex = 7;
  1428. this._output_button1.Tag = "";
  1429. this._output_button1.Text = "内容";
  1430. this._output_button1.Click += new System.EventHandler(this._output_button1_Click);
  1431. // 
  1432. // _output_listBox
  1433. // 
  1434. this._output_listBox.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
  1435. | System.Windows.Forms.AnchorStyles.Left) 
  1436. | System.Windows.Forms.AnchorStyles.Right);
  1437. this._output_listBox.ItemHeight = 12;
  1438. this._output_listBox.Location = new System.Drawing.Point(12, 34);
  1439. this._output_listBox.Name = "_output_listBox";
  1440. this._output_listBox.Size = new System.Drawing.Size(200, 232);
  1441. this._output_listBox.TabIndex = 6;
  1442. this._output_listBox.SelectedIndexChanged += new System.EventHandler(this._output_listBox_SelectedIndexChanged);
  1443. // 
  1444. // _Output_label
  1445. // 
  1446. this._Output_label.Location = new System.Drawing.Point(12, 10);
  1447. this._Output_label.Name = "_Output_label";
  1448. this._Output_label.Size = new System.Drawing.Size(200, 24);
  1449. this._Output_label.TabIndex = 5;
  1450. // 
  1451. // _panelQuery
  1452. // 
  1453. this._panelQuery.Controls.AddRange(new System.Windows.Forms.Control[] {
  1454.   this._query_comboBoxFilter2,
  1455.   this._query_button,
  1456.   this._query_checkBox3,
  1457.   this._query_checkBox2,
  1458.   this._query_checkBox1,
  1459.   this._query_comboBoxFilter,
  1460.   this._query_txtTel,
  1461.   this._query_txtName,
  1462.   this._query_label3,
  1463.   this._query_label2,
  1464.   this._query_label1});
  1465. this._panelQuery.Location = new System.Drawing.Point(244, 47);
  1466. this._panelQuery.Name = "_panelQuery";
  1467. this._panelQuery.Size = new System.Drawing.Size(216, 400);
  1468. this._panelQuery.TabIndex = 13;
  1469. this._panelQuery.Visible = false;
  1470. // 
  1471. // _query_comboBoxFilter2
  1472. // 
  1473. this._query_comboBoxFilter2.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1474. | System.Windows.Forms.AnchorStyles.Right);
  1475. this._query_comboBoxFilter2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1476. this._query_comboBoxFilter2.Location = new System.Drawing.Point(8, 152);
  1477. this._query_comboBoxFilter2.Name = "_query_comboBoxFilter2";
  1478. this._query_comboBoxFilter2.Size = new System.Drawing.Size(200, 20);
  1479. this._query_comboBoxFilter2.TabIndex = 22;
  1480. // 
  1481. // _query_button
  1482. // 
  1483. this._query_button.Location = new System.Drawing.Point(8, 184);
  1484. this._query_button.Name = "_query_button";
  1485. this._query_button.Size = new System.Drawing.Size(72, 24);
  1486. this._query_button.TabIndex = 21;
  1487. this._query_button.Text = "搜索";
  1488. this._query_button.Click += new System.EventHandler(this._query_button_Click);
  1489. // 
  1490. // _query_checkBox3
  1491. // 
  1492. this._query_checkBox3.Location = new System.Drawing.Point(8, 264);
  1493. this._query_checkBox3.Name = "_query_checkBox3";
  1494. this._query_checkBox3.Size = new System.Drawing.Size(176, 24);
  1495. this._query_checkBox3.TabIndex = 20;
  1496. this._query_checkBox3.Text = "电话为模糊查询";
  1497. // 
  1498. // _query_checkBox2
  1499. // 
  1500. this._query_checkBox2.Location = new System.Drawing.Point(8, 240);
  1501. this._query_checkBox2.Name = "_query_checkBox2";
  1502. this._query_checkBox2.Size = new System.Drawing.Size(176, 24);
  1503. this._query_checkBox2.TabIndex = 19;
  1504. this._query_checkBox2.Text = "地名为模糊查询";
  1505. // 
  1506. // _query_checkBox1
  1507. // 
  1508. this._query_checkBox1.Location = new System.Drawing.Point(8, 216);
  1509. this._query_checkBox1.Name = "_query_checkBox1";
  1510. this._query_checkBox1.Size = new System.Drawing.Size(176, 24);
  1511. this._query_checkBox1.TabIndex = 18;
  1512. this._query_checkBox1.Text = "地名和电话的组合关系为与";
  1513. // 
  1514. // _query_comboBoxFilter
  1515. // 
  1516. this._query_comboBoxFilter.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1517. | System.Windows.Forms.AnchorStyles.Right);
  1518. this._query_comboBoxFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1519. this._query_comboBoxFilter.Location = new System.Drawing.Point(8, 120);
  1520. this._query_comboBoxFilter.Name = "_query_comboBoxFilter";
  1521. this._query_comboBoxFilter.Size = new System.Drawing.Size(200, 20);
  1522. this._query_comboBoxFilter.TabIndex = 17;
  1523. this._query_comboBoxFilter.SelectedIndexChanged += new System.EventHandler(this._query_comboBoxFilter_SelectedIndexChanged);
  1524. // 
  1525. // _query_txtTel
  1526. // 
  1527. this._query_txtTel.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1528. | System.Windows.Forms.AnchorStyles.Right);
  1529. this._query_txtTel.Location = new System.Drawing.Point(8, 72);
  1530. this._query_txtTel.Name = "_query_txtTel";
  1531. this._query_txtTel.Size = new System.Drawing.Size(200, 21);
  1532. this._query_txtTel.TabIndex = 16;
  1533. this._query_txtTel.Text = "";
  1534. // 
  1535. // _query_txtName
  1536. // 
  1537. this._query_txtName.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
  1538. | System.Windows.Forms.AnchorStyles.Right);
  1539. this._query_txtName.Location = new System.Drawing.Point(8, 24);
  1540. this._query_txtName.Name = "_query_txtName";
  1541. this._query_txtName.Size = new System.Drawing.Size(200, 21);
  1542. this._query_txtName.TabIndex = 15;
  1543. this._query_txtName.Text = "";
  1544. // 
  1545. // _query_label3
  1546. // 
  1547. this._query_label3.Location = new System.Drawing.Point(8, 104);
  1548. this._query_label3.Name = "_query_label3";
  1549. this._query_label3.Size = new System.Drawing.Size(72, 16);
  1550. this._query_label3.TabIndex = 14;
  1551. this._query_label3.Text = "被过滤:";
  1552. // 
  1553. // _query_label2
  1554. // 
  1555. this._query_label2.Location = new System.Drawing.Point(8, 56);
  1556. this._query_label2.Name = "_query_label2";
  1557. this._query_label2.Size = new System.Drawing.Size(72, 16);
  1558. this._query_label2.TabIndex = 13;
  1559. this._query_label2.Text = "电话:";
  1560. // 
  1561. // _query_label1
  1562. // 
  1563. this._query_label1.Location = new System.Drawing.Point(8, 8);
  1564. this._query_label1.Name = "_query_label1";
  1565. this._query_label1.Size = new System.Drawing.Size(72, 16);
  1566. this._query_label1.TabIndex = 12;
  1567. this._query_label1.Text = "地名:";
  1568. // 
  1569. // _timer
  1570. // 
  1571. this._timer.Enabled = true;
  1572. this._timer.Tick += new System.EventHandler(this._timer_Tick);
  1573. // 
  1574. // _toolBar16
  1575. // 
  1576. this._toolBar16.DropDownArrows = true;
  1577. this._toolBar16.Name = "_toolBar16";
  1578. this._toolBar16.ShowToolTips = true;
  1579. this._toolBar16.Size = new System.Drawing.Size(704, 39);
  1580. this._toolBar16.TabIndex = 21;
  1581. this._toolBar16.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this._toolBar16_ButtonClick);
  1582. // 
  1583. // statusBarPanel1
  1584. // 
  1585. this.statusBarPanel1.Text = "北京市地理信息公众查询系统";
  1586. this.statusBarPanel1.Width = 300;
  1587. // 
  1588. // statusBarPanel2
  1589. // 
  1590. this.statusBarPanel2.Text = "北纬=0000.00 东经=0000.00";
  1591. this.statusBarPanel2.Width = 200;
  1592. // 
  1593. // statusBarPanel4
  1594. // 
  1595. this.statusBarPanel4.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
  1596. this.statusBarPanel4.Width = 500;
  1597. // 
  1598. // _statusBar
  1599. // 
  1600. this._statusBar.Location = new System.Drawing.Point(0, 470);
  1601. this._statusBar.Name = "_statusBar";
  1602. this._statusBar.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
  1603.   this.statusBarPanel1,
  1604.   this.statusBarPanel2,
  1605.   this.statusBarPanel3,
  1606.   this.statusBarPanel4});
  1607. this._statusBar.ShowPanels = true;
  1608. this._statusBar.Size = new System.Drawing.Size(704, 24);
  1609. this._statusBar.TabIndex = 0;
  1610. // 
  1611. // _toolBar2
  1612. // 
  1613. this._toolBar2.Dock = System.Windows.Forms.DockStyle.Left;
  1614. this._toolBar2.DropDownArrows = true;
  1615. this._toolBar2.Location = new System.Drawing.Point(0, 39);
  1616. this._toolBar2.Name = "_toolBar2";
  1617. this._toolBar2.ShowToolTips = true;
  1618. this._toolBar2.Size = new System.Drawing.Size(39, 431);
  1619. this._toolBar2.TabIndex = 22;
  1620. this._toolBar2.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this._toolBar2_ButtonClick);
  1621. // 
  1622. // _map
  1623. // 
  1624. this._map.Dock = System.Windows.Forms.DockStyle.Fill;
  1625. this._map.Location = new System.Drawing.Point(39, 39);
  1626. this._map.Name = "_map";
  1627. this._map.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_map.OcxState")));
  1628. this._map.Size = new System.Drawing.Size(665, 431);
  1629. this._map.TabIndex = 24;
  1630. this._map.MouseDownEvent += new AxMapObjects2._DMapEvents_MouseDownEventHandler(this._map_MouseDownEvent);
  1631. this._map.AfterLayerDraw += new AxMapObjects2._DMapEvents_AfterLayerDrawEventHandler(this._map_AfterLayerDraw);
  1632. this._map.MouseMoveEvent += new AxMapObjects2._DMapEvents_MouseMoveEventHandler(this._map_MouseMoveEvent);
  1633. // 
  1634. // _picToolTip
  1635. // 
  1636. this._picToolTip.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
  1637. this._picToolTip.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  1638. this._picToolTip.Location = new System.Drawing.Point(320, 239);
  1639. this._picToolTip.Name = "_picToolTip";
  1640. this._picToolTip.Size = new System.Drawing.Size(64, 16);
  1641. this._picToolTip.TabIndex = 26;
  1642. this._picToolTip.TabStop = false;
  1643. // 
  1644. // _lblToolTip
  1645. // 
  1646. this._lblToolTip.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(192)));
  1647. this._lblToolTip.Location = new System.Drawing.Point(328, 239);
  1648. this._lblToolTip.Name = "_lblToolTip";
  1649. this._lblToolTip.Size = new System.Drawing.Size(48, 16);
  1650. this._lblToolTip.TabIndex = 27;
  1651. this._lblToolTip.Text = "label1";
  1652. // 
  1653. // frmMain
  1654. // 
  1655. this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
  1656. this.ClientSize = new System.Drawing.Size(704, 494);
  1657. this.Controls.AddRange(new System.Windows.Forms.Control[] {
  1658.   this._lblToolTip,
  1659.   this._picToolTip,
  1660.   this._map,
  1661.   this._toolBar2,
  1662.   this._toolBar16,
  1663.   this._comboBox,
  1664.   this._statusBar,
  1665.   this._panelQuery,
  1666.   this._panelOutput,
  1667.   this._panelDist,
  1668.   this._panelIndex,
  1669.   this._panelBus});
  1670. this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  1671. this.Name = "frmMain";
  1672. this.Text = "北京市地理信息公众查询系统";
  1673. this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
  1674. this.Resize += new System.EventHandler(this.frmMain_Resize);
  1675. this.Closing += new System.ComponentModel.CancelEventHandler(this.frmMain_Closing);
  1676. this.Load += new System.EventHandler(this.frmMain_Load);
  1677. this._panelBus.ResumeLayout(false);
  1678. this._panelDist.ResumeLayout(false);
  1679. this._panelIndex.ResumeLayout(false);
  1680. this._panelOutput.ResumeLayout(false);
  1681. this._panelQuery.ResumeLayout(false);
  1682. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).EndInit();
  1683. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).EndInit();
  1684. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).EndInit();
  1685. ((System.ComponentModel.ISupportInitialize)(this.statusBarPanel4)).EndInit();
  1686. ((System.ComponentModel.ISupportInitialize)(this._map)).EndInit();
  1687. this.ResumeLayout(false);
  1688. }
  1689. #endregion
  1690. /// <summary>
  1691. /// The main entry point for the application.
  1692. /// </summary>
  1693. [STAThread]
  1694. static void Main(string[] args) 
  1695. {
  1696. frmMain frm = new frmMain(); 
  1697. Application.Run(frm);
  1698. }
  1699. #region Form消息处理
  1700. /// //////////////////////////////////////////////////////////////////////////////////////////////
  1701. ///功能:From被装载后,
  1702. ///参数:
  1703. ///返回值:void
  1704. /////////////////////////////////////////////////////////////////////////////////////////////////
  1705. private void frmMain_Load(object sender, System.EventArgs e)
  1706. {
  1707. if (_environment.m_nCurrMapIndex >= 0 )
  1708. {
  1709. // 在地图窗口中加入图层
  1710. LoadLayers();
  1711. // 在鹰眼窗口中加入图层
  1712. LoadLayersForEagleEye();
  1713. }
  1714. ReShowLayers();
  1715. ReloadToolbar();
  1716. _map.Extent = _environment.m_mapInfos[0].rect;
  1717. _map.MousePointer = MapObjects2.MousePointerConstants.moArrow;
  1718. }
  1719. private void frmMain_Resize(object sender, System.EventArgs e)
  1720. {
  1721. this._comboBox.Height = this._statusBar.Height - 4;  
  1722. this._comboBox.Top = this.Height  - this._comboBox.Height - 28;  
  1723. }
  1724. private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
  1725. {
  1726. //退出系统时,提示
  1727. if (DialogResult.Cancel == MessageBox.Show("确认退出吗?","北京市地理信息公众查询系统",MessageBoxButtons.OKCancel,MessageBoxIcon.Question ))
  1728. e.Cancel = true;
  1729. }
  1730. #endregion
  1731. ///////////////////////////////////////////////////////////////////////////////////////////// 
  1732. ///功能:根据每个图层的显示比例而设置图层是否显示
  1733. ///参数:
  1734. ///返回值
  1735. ///////////////////////////////////////////////////////////////////////////////////////////
  1736. private void ReShowLayers()
  1737. {
  1738. double dScale = _environment.CalcScale(_map); //地图显示比例
  1739. for (int i = 0; i < _environment.m_nLayerNum; i ++)
  1740. {
  1741. if (!_environment.m_layerInfos[i].bVisible) 
  1742. continue;
  1743. if (dScale <  _environment.m_layerInfos[i].dShowScale)
  1744. {
  1745. _environment.m_layerInfos[i].layer.Visible = true;
  1746. }
  1747. else
  1748. {
  1749. _environment.m_layerInfos[i].layer.Visible = false;
  1750. }
  1751. }
  1752. }
  1753. /// <summary>
  1754. /// 根据图层可见性,设置地名快捷方式工具条上按钮的状态
  1755. /// </summary>
  1756. private void ReloadToolbar()
  1757. {
  1758. if (_environment.GetLayerVisible((int)MapDisp.MO_HOSPITAL )  &&
  1759. _environment.GetLayerVisible((int)MapDisp.MO_HOTEL )  &&
  1760. _environment.GetLayerVisible((int)MapDisp.MO_POST )  &&
  1761. _environment.GetLayerVisible((int)MapDisp.MO_SCHOOL )  &&
  1762. _environment.GetLayerVisible((int)MapDisp.MO_STATION )  &&
  1763. _environment.GetLayerVisible((int)MapDisp.MO_SHOP )  &&
  1764. _environment.GetLayerVisible((int)MapDisp.MO_TOUR ))
  1765. {
  1766. _toolBar2.Buttons[2].Pushed = true;
  1767. _toolBar2.Buttons[2].ImageIndex = 13;
  1768. }
  1769. else
  1770. {
  1771. _toolBar2.Buttons[2].Pushed = false;
  1772. _toolBar2.Buttons[2].ImageIndex = 14;
  1773. }
  1774. if (_environment.GetLayerVisible((int)MapDisp.MO_SHOP)) 
  1775. _toolBar2.Buttons[3].Pushed = true;
  1776. else
  1777. _toolBar2.Buttons[3].Pushed = false;
  1778. if (_environment.GetLayerVisible((int)MapDisp.MO_TOUR)) 
  1779. _toolBar2.Buttons[4].Pushed = true;
  1780. else
  1781. _toolBar2.Buttons[4].Pushed = false;
  1782. if (_environment.GetLayerVisible((int)MapDisp.MO_SCHOOL)) 
  1783. _toolBar2.Buttons[5].Pushed = true;
  1784. else
  1785. _toolBar2.Buttons[5].Pushed = false;
  1786. if (_environment.GetLayerVisible((int)MapDisp.MO_HOSPITAL)) 
  1787. _toolBar2.Buttons[6].Pushed = true;
  1788. else
  1789. _toolBar2.Buttons[6].Pushed = false;
  1790. //宾馆分布
  1791. if (_environment.GetLayerVisible((int)MapDisp.MO_HOTEL)) 
  1792. _toolBar2.Buttons[7].Pushed = true;
  1793. else
  1794. _toolBar2.Buttons[7].Pushed = false;
  1795. //银行分布
  1796. if (_environment.GetLayerVisible((int)MapDisp.MO_BANK )) 
  1797. _toolBar2.Buttons[8].Pushed = true;
  1798. else
  1799. _toolBar2.Buttons[8].Pushed = false;
  1800. //加油站分布
  1801. if (_environment.GetLayerVisible((int)MapDisp.MO_GAS )) 
  1802. _toolBar2.Buttons[9].Pushed = true;
  1803. else
  1804. _toolBar2.Buttons[9].Pushed = false;
  1805. //电影音乐厅分布
  1806. if (_environment.GetLayerVisible((int)MapDisp.MO_MOVIE )) 
  1807. _toolBar2.Buttons[10].Pushed = true;
  1808. else
  1809. _toolBar2.Buttons[10].Pushed = false;
  1810. //餐馆分布
  1811. if (_environment.GetLayerVisible((int)MapDisp.MO_RESTAURANT )) 
  1812. _toolBar2.Buttons[11].Pushed = true;
  1813. else
  1814. _toolBar2.Buttons[11].Pushed = false;
  1815. //WC分布
  1816. if (_environment.GetLayerVisible((int)MapDisp.MO_WS )) 
  1817. _toolBar2.Buttons[12].Pushed = true;
  1818. else
  1819. _toolBar2.Buttons[12].Pushed = false;
  1820. //邮局分布
  1821. if (_environment.GetLayerVisible((int)MapDisp.MO_POST )) 
  1822. _toolBar2.Buttons[13].Pushed = true;
  1823. else
  1824. _toolBar2.Buttons[13].Pushed = false;
  1825. //图书馆分布
  1826. if (_environment.GetLayerVisible((int)MapDisp.MO_LIBRAY )) 
  1827. _toolBar2.Buttons[14].Pushed = true;
  1828. else
  1829. _toolBar2.Buttons[14].Pushed = false;
  1830. //车站分布
  1831. if (_environment.GetLayerVisible((int)MapDisp.MO_STATION)) 
  1832. _toolBar2.Buttons[15].Pushed = true;
  1833. else
  1834. _toolBar2.Buttons[15].Pushed = false;
  1835. }
  1836. /// //////////////////////////////////////////////////////////////////////////////////////////////
  1837. ///功能:装载鹰眼图层
  1838. ///参数:无
  1839. ///返回值:void
  1840. /////////////////////////////////////////////////////////////////////////////////////////////////
  1841. private void LoadLayersForEagleEye()
  1842. {
  1843. _mapEye.Layers.Clear(); 
  1844. for (int i = 0; i < _environment.m_nLayerNum; i ++)
  1845. {
  1846. MapObjects2.MapLayer layer = new MapObjects2.MapLayer();
  1847. if (_environment.m_layerInfos[i].szType.Equals("北京纵览"))
  1848. {
  1849. layer.GeoDataset = _environment.m_db.FindGeoDataset(_environment.m_layerInfos[i].szFileName);  
  1850. if (layer.Valid )
  1851. {
  1852. if (layer.shapeType == MapObjects2.ShapeTypeConstants.moShapeTypePoint)
  1853. continue;
  1854. if (layer.shapeType == MapObjects2.ShapeTypeConstants.moShapeTypeLine)
  1855. continue;
  1856. _mapEye.Layers.Add(layer);
  1857. switch (_environment.m_layerInfos[i].layer.shapeType)
  1858. {
  1859. case MapObjects2.ShapeTypeConstants.moShapeTypePoint:
  1860. //点符号
  1861. if (_environment.m_layerInfos[i].nCharacterIndex >= 0 )
  1862. {
  1863. stdole.StdFont fnt = new stdole.StdFont();
  1864. fnt.Name = _environment.m_layerInfos[i].szFontName;
  1865. layer.Symbol.Font = fnt;
  1866. layer.Symbol.CharacterIndex = (short)_environment.m_layerInfos[i].nCharacterIndex;
  1867. layer.Symbol.Style = 4;
  1868. layer.Symbol.SymbolType = MapObjects2.SymbolTypeConstants.moPointSymbol;
  1869. layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
  1870. }
  1871. else
  1872. {
  1873. layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
  1874. }
  1875. break;
  1876. case MapObjects2.ShapeTypeConstants.moShapeTypeLine:
  1877. //线符号
  1878. if (_environment.m_layerInfos[i].nCharacterIndex >= 0 && _environment.m_layerInfos[i].nCharacterIndex < 5)
  1879. {
  1880. layer.Symbol.Style = (short)_environment.m_layerInfos[i].nCharacterIndex;
  1881. }
  1882. else if (_environment.m_layerInfos[i].nCharacterIndex > 0)
  1883. {
  1884. MOSYMBOLLib.MoPenset ps = new MOSYMBOLLib.MoPenset();
  1885. ps.Load("LineStyle.lin");
  1886. layer.Symbol.Custom = ps.get_Item(_environment.m_layerInfos[i].nCharacterIndex); 
  1887. }
  1888. layer.Symbol.Size = (short)_environment.m_layerInfos[i].nSymSize;
  1889. break;
  1890. case MapObjects2.ShapeTypeConstants.moShapeTypePolygon:
  1891. layer.Symbol.Outline = false;
  1892. if (_environment.m_layerInfos[i].nCharacterIndex >= 0 && _environment.m_layerInfos[i].nCharacterIndex <= 10)
  1893. {
  1894. layer.Symbol.Style = (short)_environment.m_layerInfos[i].nCharacterIndex;
  1895. }
  1896. else if (100 == _environment.m_layerInfos[i].nCharacterIndex)
  1897. {
  1898. SetPolygonLayerColor(layer, "名称","颜色",false);
  1899. }
  1900. break;
  1901. }
  1902. //设置颜色
  1903. if (_environment.m_layerInfos[i].nSymColor != CEnvironment.SYMBOL_COLOR_NONE)
  1904. {
  1905. layer.Symbol.Color =_environment.m_layerInfos[i].nSymColor;
  1906. }
  1907. }
  1908. }
  1909. }
  1910. _mapEye.Extent = _mapEye.FullExtent; 
  1911. }
  1912. /// //////////////////////////////////////////////////////////////////////////////////////////////
  1913. ///功能:装载图层
  1914. ///参数:无
  1915. ///返回值:void
  1916. /////////////////////////////////////////////////////////////////////////////////////////////////
  1917. private void LoadLayers()
  1918. {
  1919. _map.Layers.Clear();
  1920. _map.ScrollBars = false; 
  1921. for (int m = 0; m < 3; m ++)
  1922. {
  1923. for (int i = 0; i < _environment.m_nLayerNum; i ++)
  1924. {
  1925. MapObjects2.MapLayer layer;
  1926. layer = new MapObjects2.MapLayer();
  1927. MapObjects2.GeoDataset gds;
  1928. gds = _environment.m_db.FindGeoDataset(_environment.m_layerInfos[i].szFileName);  
  1929. layer.GeoDataset = gds;
  1930. if (layer.Valid)
  1931. {
  1932. switch (m)
  1933. {
  1934. case 0:
  1935. if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypePolygon)
  1936. continue;
  1937. break;
  1938. case 1:
  1939. if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypeLine)
  1940. continue;
  1941. break;
  1942. case 2:
  1943. if (layer.shapeType != MapObjects2.ShapeTypeConstants.moShapeTypePoint)
  1944. continue;
  1945. break;
  1946. default:
  1947. continue;
  1948. }
  1949. _environment.m_layerInfos[i].layer = layer;
  1950. this._map._Layers.Add(_environment.m_layerInfos[i].layer);
  1951. //设置图层是否显示
  1952. if (!_environment.m_layerInfos[i].bVisible)
  1953. _environment.m_layerInfos[i].layer.Visible = false;