IOS Integration Baidu SDK Please refer to the official Baidu map document, here is not more verbose
This article is introduced in the Baidu map according to latitude and longitude, custom bubbles, bubble position offset, in our celestial this thing is very common, also familiar with, in the project Baidu map of the SDK, the location of various wrong, Baidu maps and other maps, such as gold, they have their own migration algorithm, There are a lot of things on the internet, such as Mars coordinate conversion, that are not ready to be displayed.
In fact, Baidu SDK has his own migration algorithm, the use of Baidu offset conversion can be
Bmkpointannotation *annotation =[[Bmkpointannotation alloc]init]; Cllocationcoordinate2d coor; //The latitude and longitude of the descendants need to be displayedCoor.longitude =[Longitude Floatvalue]; Coor.latitude=[Latitudes Floatvalue];/** coordinate conversion function, from original GPS coordinates, Mapbar coordinates, Google coordinates, 51 map coordinates, MAPABC coordinates to Baidu coordinates (51 map coordinates need to show 10000) * @param coordinate coordinates to be converted * @param Type of coordinate system to be converted, GPS for the original GPS coordinates, common for Google coordinates, 51 map coordinates, MAPABC coordinates * @return The returned nsdictionry contains "x", "Y" fields, each corresponding to the X after Base64 encryption , y-coordinate*/nsdictionary*dict =Bmkconvertbaiducoorfrom (COOR,BMK_COORDTYPE_GPS);/** *base64 Encrypted coordinate dictionary decryption function * @param dictionary with decrypted Nsdictionry, the nsdictionry should contain "x", "Y" field, each corresponding to Base64 encryption after the x, y coordinates *@ The coordinates after return decryption*/cllocationcoordinate2d Baiducoor= Bmkcoordictionarydecode (dict);//Convert to Baidu map required latitude and longitudeannotation.coordinate= Baiducoor;//
For more details, please refer to the official Baidu map document.
IOS integrated Baidu Map Location offset problem