iOS开发 火星坐标转百度坐标

时间:2022-01-09 19:44:08

CLLocationCoordinate2D coor = CLLocationCoordinate2DMake(latitude, longitude);//原始坐标

//转换 google地图、soso地图、aliyun地图、mapabc地图和amap地图所用坐标至百度坐标

NSDictionary* testdic = BMKConvertBaiduCoorFrom(coor,BMK_COORDTYPE_GPS);

//转换GPS坐标至百度坐标(加密后的坐标)

testdic = BMKConvertBaiduCoorFrom(coor,BMK_COORDTYPE_GPS);

NSLog(@"x=%@,y=%@",[testdic objectForKey:@"x"],[testdic objectForKey:@"y"]);

//解密加密后的坐标字典

CLLocationCoordinate2D baiduCoor = BMKCoorDictionaryDecode(testdic);//转换后的百度坐标

return baiduCoor;