예제 #1
0
        /// <summary>
        /// 屏幕坐标转经纬度
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public PointLatLng PointToLatLng(PointInt p)
        {
            PointLatLng pll  = null;
            var         pPix = MapCenterPix.GetOffSet(p.X - ScreenArea.Width / 2, p.Y - ScreenArea.Height / 2);

            pll = MercatorHelper.PixelToLatLng(pPix, Zoom);
            return(pll);
        }
예제 #2
0
        /// <summary>
        /// 地图中心偏移
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public void CenterMove(double x, double y, bool isUpdateTiles = true)
        {
            var centerPix = MapCenterPix;

            centerPix            = MapCenterPix.GetOffSet(x, y);
            _mapCenter           = MercatorHelper.PixelToLatLng(centerPix, Zoom);
            _isNeedToUpdateTiles = true;
            //Debug.WriteLine(string.Format("****缩放:鼠标点:【{0}】,中心坐标点:【{1}】,中心像素点:【{2}】,鼠标像素点【{3}】,鼠标经纬度【{8}】,层级:【{4}】,屏幕中心点:【{5}】\r\n像素偏移{6},屏幕坐标点偏移{7}"));

            if (RectTilesBitmap != null && RectTilesBitmap.Contains(TilesArea) && RotationAngle == 0)
            {
                RectTilesBitmap.OffSet(-(int)x, -(int)y);
            }
            else
            {
                if (isUpdateTiles)
                {
                    UpdateDrawTiles();
                }
            }

            //TileDrawOffset.Offset(-(int)x, -(int)y);
        }