IOS development based on Baidu map (2) -- getting poi

Source: Internet
Author: User

1. Search first

 
Cllocationdistance radiusmeters = 1000; // set the search range bmksearch * search = [[bmksearch alloc] init]; // create a search object search. delegate = self; // The proxy is set to itself. After searching, the function [search into earchnearby: "KFC" center: mapview. centercoordinate radius: radiusmeters pageindex: 0]; // search for KFC in the center of the screen // [Search release]; // Note: release is not supported; otherwise, it cannot be searched. Define search as a member variable.

2. Process search results

 
-(Void) ongetpoiresult :( nsarray *) poiresultlist searchtype :( INT) type errorcode :( INT) error {If (error = bmkerrok) {bmkpoiresult * result = [poiresultlist objectatindex: 0]; for (INT I = 0; I <result. poiinfolist. count; ++ I) {bmkpoiinfo * poi = [result. poiinfolist objectatindex: I]; bmkpointannotation * Item = [[bmkpointannotation alloc] init]; item. coordinate = poi.pt; item. title = poi. name; [mapview addannotation: item]; [item release] ;}}

The above callback will automatically display the searched poi on the map through annotation.

IOS development based on Baidu map (1) -- current user location

IOS development based on Baidu map (2) -- getting poi

IOS development based on Baidu map (3) -- address search

IOS development based on Baidu map (4) -- path search

IOS development based on Baidu map (5)-Summary of core issues

IOS development based on Baidu map (6) -- Google coordinates to hundreds of coordinates

IOS development based on Baidu map (7) -- convert Baidu coordinates to Google coordinates

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.