private void textBox1_MouseWheel(object sender, MouseEventArgs e) { if (e.Delta > 0) { mouseEvent = true; mapX += (e.X) / 256; mapY += (e.Y) / 256; mapX *= 2; mapY *= 2; enlarge2(); if (Form1.showMRT == true) { MrtLayer.drawLine(); } this.Refresh(); } else { mouseEvent = true; reduce(); if (Form1.showMRT == true) { MrtLayer.drawLine(); } this.Refresh(); } }
private void button1_Click(object sender, EventArgs e) //放大 { MapView.enlarge2(); if (showMRT == true) { MrtLayer.drawLine(); } if (MapView.testFlag == true) { TownLayer.drawPolygon(); } if (MapView.iconFlag == true) { LandmarkLayer land = new LandmarkLayer(); land.drawIcon(MapView.mapX * 256 + 1365, MapView.mapX * 256, MapView.mapY * 256 + 1365, MapView.mapY * 256, out MapView.ltox, out MapView.ltoy, out MapView.cate); } this.Text = "X: " + MapView.mapX + " " + " Y: " + MapView.mapY + " lavel: " + MapView.level; if (MapView.iconFlag == true) { test.drawIcon(MapView.mapX * 256 + 1365, MapView.mapX * 256, MapView.mapY * 256 + 1365, MapView.mapY * 256, out MapView.ltox, out MapView.ltoy, out MapView.cate); } if (MapView.locateFlag == true) { locateXY(); } mapView1.Invalidate(); }
private void button2_Click(object sender, EventArgs e) // 縮小 { MapView.reduce(); if (showMRT == true) { MrtLayer.drawLine(); } if (MapView.testFlag == true) { TownLayer.drawPolygon(); } this.Text = "X: " + MapView.mapX + " " + " Y: " + MapView.mapY + " leval: " + MapView.level; if (MapView.iconFlag == true) { test.drawIcon(MapView.mapX * 256 + 1365, MapView.mapX * 256, MapView.mapY * 256 + 1365, MapView.mapY * 256, out MapView.ltox, out MapView.ltoy, out MapView.cate); } if (MapView.locateFlag == true) { locateXY(); } mapView1.Invalidate(); }
private void button1_Click(object sender, EventArgs e) { if (conection.identify(textBox1.Text, textBox2.Text)) { MessageBox.Show("登入成功", "登入系統"); Form1.UserAccount = textBox1.Text; int[] query = new int [6]; char layer = ' '; conection.userLogin(out query, out flag, out layer, Form1.UserAccount); if (query[0] != 1000) { MapView.loginMap(query[0], query[1], query[2], query[3], query[4], query[5], flag[0], flag[1], flag[2], layer); } if (flag[0] == true) { MrtLayer.drawLine(); Form1.showMRT = true; } if (flag[1] == true) { TownLayer.drawPolygon(); MapView.testFlag = true; } if (flag[2] == true) { LandmarkLayer test = new LandmarkLayer(); test.drawIcon(MapView.mapX * 256 + 1024, MapView.mapX * 256, MapView.mapY * 256 + 1024, MapView.mapY * 256, out MapView.ltox, out MapView.ltoy, out MapView.cate); MapView.iconFlag = true; } LAY = layer; textBox1.Text = ""; textBox2.Text = ""; this.Visible = false; Form1.paintFlag = true; this.Parent.Invalidate(); } else { MessageBox.Show("帳號或密碼有誤!!", "輸入錯誤"); } }
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e) { if (treeView1.Nodes[0].Checked == true) { foreach (TreeNode ChildeNode in e.Node.Nodes) { ChildeNode.Checked = true; } } else { foreach (TreeNode ChildeNode in e.Node.Nodes) { ChildeNode.Checked = false; } } if (treeView1.Nodes[0].Nodes[0].Checked == true) { MapView.MRTFocus(); if (showMRT == false) { MrtLayer.drawLine(); showMRT = true; } } else { showMRT = false; } if (treeView1.Nodes[0].Nodes[1].Checked == true) { if (MapView.testFlag == false) { TownLayer.drawPolygon(); MapView.testFlag = true; } } else { MapView.testFlag = false; } if (treeView1.Nodes[0].Nodes[2].Checked == true) { if (MapView.iconFlag == false) { MapView.iconFlag = true; } LandmarkLayer test = new LandmarkLayer(); test.drawIcon(MapView.mapX * 256 + 1024, MapView.mapX * 256, MapView.mapY * 256 + 1024, MapView.mapY * 256, out MapView.ltox, out MapView.ltoy, out MapView.cate); } else { MapView.iconFlag = false; } if (e.Node == treeView1.Nodes[1].Nodes[0]) { if (treeView1.Nodes[1].Nodes[0].Checked == true) { MapView.layer = 'a'; treeView1.Nodes[1].Nodes[1].Checked = false; treeView1.Nodes[1].Nodes[2].Checked = false; } } if (e.Node == treeView1.Nodes[1].Nodes[1]) { if (treeView1.Nodes[1].Nodes[1].Checked == true) { MapView.layer = 'r'; treeView1.Nodes[1].Nodes[0].Checked = false; treeView1.Nodes[1].Nodes[2].Checked = false; } } if (e.Node == treeView1.Nodes[1].Nodes[2]) { if (treeView1.Nodes[1].Nodes[2].Checked == true) { MapView.layer = 'h'; treeView1.Nodes[1].Nodes[0].Checked = false; treeView1.Nodes[1].Nodes[1].Checked = false; } } WebClient wc = new WebClient(); MapView.m_Images.Clear(); if (MapView.level == 1) { MapView.range = 2; } for (int i = 0; i < MapView.range * MapView.range; i++) { MapView.m_Images.Add(Image.FromStream(new MemoryStream(wc.DownloadData("https://ecn.t1.tiles.virtualearth.net/tiles/" + MapView.layer + MapView.s[i] + ".jpeg?g=3649")))); } this.Refresh(); }