IOS-Andriod Baidu map imitation Baidu takeout-ELE. Me-select my address-POI search/, ios-andriod-poi

Source: Internet
Author: User

IOS-Andriod Baidu map imitation Baidu takeout-ELE. Me-select my address-POI search/, ios-andriod-poi

Bytes/

Baidu take-out select delivery address: ELE. Me select delivery address:

Baidu map api Official Website

Figure 1Put a UIImageView In The Middle Of The MapView, and the following map is running when we drag it.

-(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 coordinates of the center point of the screen, that is, UIImageView:

Geo.reverseGeoPoint=mapStatus.tar getGeoPt;

Geo is BMKReverseGeoCodeOption * geo; it is called after the mobile operation is completed:

-(Void) mapStatusDidChanged :( BMKMapView *) mapView {

BMKMapStatus * mapStatus = [mapView getMapStatus];

Geo.reverseGeoPoint=mapStatus.tar getGeoPt;

[_ GeoSearcher reverseGeoCode: geo];

NSLog (@ "mapStatusDidChanged ");

}

The callback function obtains the decompilation result and the surrounding 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];

}

Figure 2I started to use the online suggestion query and found that this POI search is more useful. There are three types of POI search:

Start retrieval:

Bmkw.earch = [[bmkw.earch alloc] init];

Bmkearch. delegate = self;

BMKCitySearchOption * option = [BMKCitySearchOption new];

// Search within a city

Option. city = city;

Option. keyword = searchText;

[Bmkearch yaoearchincity: option];

 

Callback return:

-(Void) onGetPoiResult :( bmkincluearch) searcher result :( BMKPoiResult) poiResult errorCode :( BMKSearchErrorCode) errorCode {[suggestionSearchArr removeAllObjects];

[SuggestionSearchArr addObjectsFromArray: poiResult. poiInfoList];

[_ SuggestionTable reloadData];}'

 

PoiResult contains the poiInfoList member BMKPoiInfo, which is the same as the first image.

Andriod is similar to this, and the function is different. If you need a demo, you can leave a mailbox.

Related Article

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.