IOS andriod Baidu map imitation Baidu outside to sell hungry? Select My Address Poi search

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.