예제 #1
0
 public static LatLng BaiduGPS2BaiduMercator(LatLng p)
 {
     double[] arr = null;
     for (var i = 0; i < array1.Length; i++)
     {
         if (p.latitude >= array1[i])
         {
             arr = array2[i];
             break;
         }
     }
     if (arr == null)
     {
         for (var i = array1.Length - 1; i >= 0; i--)
         {
             if (p.latitude <= -array1[i])
             {
                 arr = array2[i];
                 break;
             }
         }
     }
     double[] res = BaiDuMapManager.Convertor(p.longitude, p.latitude, arr);
     return(new LatLng(res[1], res[0]));
 }
예제 #2
0
        private LatLng BaiduMercator2BaiduGPS(LatLng p)
        {
            double[] arr = null;
            LatLng   np  = new LatLng(Math.Abs(p.latitude), Math.Abs(p.longitude));

            for (var i = 0; i < array3.Length; i++)
            {
                if (np.latitude >= array3[i])
                {
                    arr = array4[i];
                    break;
                }
            }
            double[] res = BaiDuMapManager.Convertor(np.longitude, np.latitude, arr);
            return(new LatLng(res[1], res[0]));
        }
예제 #3
0
 public BaiDuMapManager()
 {
     BaiDuMapManager.inst = this;
 }