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.