Have to say, now the Baidu lbs Department is not no one, ah, sometimes make out some bad things to use
Baidu to do the inverse of the geocoding function, is sure to start the Baidu service first, these will no longer rip.
Bmkgeocodesearch *_geocodesearch = [[Bmkgeocodesearch alloc]init]; _geocodesearch.delegate = self; Bmkreversegeocodeoption *reversegeocodeoption= [[Bmkreversegeocodeoption alloc] init]; Reversegeocodeoption.reversegeopoint = cllocation.coordinate; [_geocodesearch reversegeocode:reversegeocodeoption];
This is the initialization of the inverse geocoding class, where reversegeopoint is required to do inverse geocoding poi coordinate points, and then execute Reversegeocode this method, according to geographical coordinates to obtain geo-location information.
The return result of the inverse geocoding is returned in this method, which is a listening method
/** * Return anti-geocoding search results * @param searcher Search Object * @param result Search Result * @param error error number, @see Bmksearcherrorcode */-(void) ongetrevers Egeocoderesult: (Bmkgeocodesearch *) Searcher Result: (Bmkreversegeocoderesult *) result ErrorCode: (Bmksearcherrorcode ) error;
Returns the result is the Bmkreversegeocoderesult attribute value, the specific attribute value everybody clicks the class inside to see, this I will not say more, good, the simplest inverse geocoding function.
Note: The inverse geocoding monitoring method does not call please check whether Baidu key is correct and valid, whether the authorization is successful.
When using the Geocoding feature in multiple classes, it is recommended to create common classes, function simple interest initialization, only need to receive geolocation information in the Listening Method!
Temporarily on these, we have what do not understand, can leave a message, must return, the technology will communicate more!
iOS Baidu map Inverse geocoding (based on 2.3.0--2.4.0SDK development)