Beispiel #1
0
        /// <summary>
        /// GPS转火星坐标
        /// </summary>
        /// <param name="lon"></param>
        /// <param name="lat"></param>
        /// <returns></returns>
        public static PointLatLng GPSToGCJ(double lon, double lat)
        {
            double lo, la;

            LocationTransform.ConvertWGS2Mars(lon, lat, out lo, out la);
            return(new PointLatLng(la, lo));
        }
Beispiel #2
0
        /// <summary>
        /// GPS转百度坐标
        /// </summary>
        /// <param name="lon"></param>
        /// <param name="lat"></param>
        /// <returns></returns>
        public static PointLatLng GPSToBD(double lon, double lat)
        {
            double lo, la;

            LocationTransform.ConvertWGS2Mars(lon, lat, out lo, out la);
            double[] data = LocationTransform.GCJ02ToBD09(lo, la);
            return(new PointLatLng(data[0], data[1]));
        }