Http://zanderzhang.gitcafe.io/2015/09/19/iOS-Andriod Baidu Map Imitation Baidu takeout-hungry-Choose my address-poi search/
Title:ios andriod Baidu map imitation Baidu outside to sell hungry? Select My address poi search date:2015-09-19 21:06:26
Tags
Baidu Takeout Select delivery address: Are you hungry? Select Shipping Address:
Baidu Map API website
The first figure is to put a uiimageview in The middle of the mapview, and then we drag the map at the bottom of the run.
-(void) addmiddleimage{
Uiimageview *imav=[uiimageview New];
Imav.center=_mapview.center;
Imav.bounds=cgrectmake (0, 0, 24, 36);
Imav.image=[uiimage imagenamed:@ "Poi_icon"];
[Self.view Addsubview:imav];
}
take the center point of the screen, i.e. Uiimageview the coordinates:
geo.reversegeopoint=mapstatus.targetgeopt;
Geo is bmkreversegeocodeoption *geo; The move completion is called:
-(void) mapstatusdidchanged: (Bmkmapview *) mapview{
Bmkmapstatus *mapstatus=[mapview Getmapstatus];
geo.reversegeopoint=mapstatus.targetgeopt;
[_geosearcher Reversegeocode:geo];
NSLog (@ "mapstatusdidchanged");
}
The callback function obtains the anti-compilation result and the perimeter result.poilist:
-(void) Ongetreversegeocoderesult: (Bmkgeocodesearch *) Searcher Result: (Bmkreversegeocoderesult *) result ErrorCode: ( Bmksearcherrorcode) error{
[Geoarr removeallobjects];
[Geoarr addObjectsFromArray:result.poiList];
if (Result.poiList.count) {
Bmkpoiinfo *info=result.poilist[0];
_city=info.city;
}
[_bottomtable Reloaddata];
}
The second figure , I started using the online suggestion Query , later found this poi search better use dot, it has three kinds, I use is Search in Poi city :
Start Search:
Bmkpoisearch =[[bmkpoisearch Alloc]init];
Bmkpoisearch.delegate = self;
Bmkcitysearchoption *option=[bmkcitysearchoption New];
Search in the city
Option.city =city;
Option.keyword = SearchText;
[Bmkpoisearch poisearchincity:option];
Callback returns:
-(void) Ongetpoiresult: (bmkpoisearch) Searcher Result: (Bmkpoiresult) Poiresult ErrorCode: (Bmksearcherrorcode) Errorcode{[suggestionsearcharr Removeallobjects];
[Suggestionsearcharr addObjectsFromArray:poiResult.poiInfoList];
[_suggestiontable Reloaddata];} `
in the Poiresult It 's inside . poiinfolist , members are Bmkpoiinfo , just like the first one.
Andriod is similar to this, the function is different. Friends who need demo can stay in the mailbox.
This article comes from the "Zander's blog" blog, please be sure to keep this source http://zanderzhang.blog.51cto.com/10726656/1696477
IOS andriod Baidu map imitation Baidu outside to sell hungry? Select my address poi search