コード例 #1
0
ファイル: LandmarkLayer.cs プロジェクト: z784916/docfx
        public void  drawIcon(int topx, int btnx, int topy, int btny, out List <int> lati, out List <int> longi, out List <string> cate)
        {
            double    lat, lon, lat2, lon2;
            conection con = new conection();

            BingMaps.PixelXYToLatLong(topx, topy, MapView.level, out lat, out lon);
            BingMaps.PixelXYToLatLong(btnx, btny, MapView.level, out lat2, out lon2);
            con.isExist(lat, lon, lat2, lon2, out lati, out longi, out cate);
        }
コード例 #2
0
        private void richTextBox_MouseMove(object sender, MouseEventArgs e)
        {
            if (isDragging)
            {
                if (selectionFlag == true)
                {
                    ResizeToRectangle(e.Location);
                }
                if (MapView.level < 2 && selectionFlag == false)
                {
                    mapView1.Left += (e.X - px);
                    mapView1.Top  += (e.Y - py);
                    disx          += (e.X - px);
                    disy          += (e.Y - py);
                }
                if (MapView.level > 100)
                {
                    if ((e.X - Xaxis) <= -5)
                    {
                        // Xaxis = 1;
                        WebClient wc = new WebClient();
                        MapView.m_Images.Clear();
                        MapView.s.Clear();
                        int cnt = 0;
                        for (int i = MapView.mapY; i < MapView.range + MapView.mapY; i++)
                        {
                            for (int j = MapView.mapX; j < MapView.range + MapView.mapX; j++)
                            {
                                MapView.s.Add(BingMaps.TileXYToQuadKey(j - 2, i, MapView.level));
                                MapView.m_Images.Add(Image.FromStream(new MemoryStream(wc.DownloadData("https://ecn.t1.tiles.virtualearth.net/tiles/a" + MapView.s[cnt] + ".jpeg?g=3649"))));
                                cnt++;
                            }
                        }
                        //MessageBox.Show((e.X - Xaxis)+"\n"+e.X+"\n"+Xaxis);
                    }
                }
                px      = e.X;
                py      = e.Y;
                release = 1;
                this.Refresh();
            }
            toolTip1.ToolTipIcon = ToolTipIcon.Info;
            toolTip1.ForeColor   = Color.Blue;
            toolTip1.BackColor   = Color.Gray;
            for (int i = 0; i < MapView.ltox.Count; i++)
            {
                if (e.X >= MapView.ltox[i] - 20 && e.X <= MapView.ltox[i] + 20 && e.Y <= MapView.ltoy[i] + 20 && e.Y >= MapView.ltoy[i] - 20 && MapView.iconFlag == true)
                {
                    conection con = new conection();
                    string    s = "", tile = "";
                    con.returnInfo(MapView.ltox[i], MapView.ltoy[i], out s, out tile);
                    toolTip1.ToolTipTitle = tile;
                    //Thread.Sleep(500);
                    toolTip1.Show(s, this, new Point(MapView.ltox[i], MapView.ltoy[i]));
                    break;
                }
                else
                {
                    toolTip1.RemoveAll();
                }
            }

            BingMaps.PixelXYToLatLong(e.X + MapView.mapX * 256, e.Y + MapView.mapY * 256, MapView.level, out lalitude, out longitude);
            this.Text = "lalitude: " + lalitude + "     longitude: " + longitude + "  X: " + e.X + " Y: " + e.Y + " MapX: "
                        + MapView.mapX + " MapY: " + MapView.mapY;
        }