Example #1
0
        /// <summary>
        /// 地理坐标转屏幕坐标
        /// </summary>
        /// <param name="lon">地理经度</param>
        /// <param name="lat">地理纬度</param>
        /// <param name="alt">地理高度</param>
        public Point GeographyToScenePoint(double lon, double lat, double alt = 0)
        {
            float x = 0, y = 0;

            mapControl.MgsAppBLtoXY(0, (float)lon, (float)lat, ref x, ref y);
            Point point = new Point((int)x, (int)y);

            return(point);
        }
Example #2
0
        /// <summary>
        /// 经纬度转化为屏幕坐标
        /// </summary>
        /// <param name="position">经纬度</param>
        /// <returns></returns>
        public Point FromLngLatToLocal(MapLngLat position)
        {
            float x = 0, y = 0;

            axMapControl.MgsAppBLtoXY(0, (float)position.Lng, (float)position.Lat, ref x, ref y);
            Point point = new Point((int)x, (int)y);

            return(point);
        }