| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
ncnf
9年前发布

利用高德地图poi检索,模仿微信发朋友圈选择附近位置

仿微信获取附近的地标

enter image description here

该demo基于高德地图poi检索,需要自己注册一个key,高德key申请


主要代码

AMapPOIAroundSearchRequest *request = [[AMapPOIAroundSearchRequest alloc] init];  request.location                    = [AMapGeoPoint locationWithLatitude:23.107307 longitude:113.384098];  request.keywords                    = @"";  request.sortrule                    = 0;  request.requireExtension            = YES;  request.radius                      = 1000;  request.page                        = self.pageIndex;  request.offset                      = self.pageCount;  request.types                       = @"050000|060000|070000|080000|090000|100000|110000|120000|130000|140000|150000|160000|170000";    [self.search AMapPOIAroundSearch:request];

以上代码段用于发起检索请求,获取周边的数据

#pragma mark - AMapSearchDelegate    - (void)onPOISearchDone:(AMapPOISearchBaseRequest *)request response:(AMapPOISearchResponse *)response{       if (response.pois.count == 0){          return;        }       for(AMapPOI *poi in response.pois){           NSLog(@"%@",poi.name);       }  }

以上是获取到数据的回调,在此可以获取周边信息.

使用配置

1.填入自己的key enter image description here

2.填写Bundle Indentifie (需与高德申请的安全码一致) enter image description here

3.配置-ObJC,若不配置,可以运行,会抛出[AMapGeoPoint coordinateString]错误 enter image description here

项目主页:http://www.open-open.com/lib/view/home/1448630175110

 本文由用户 ncnf 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1448630175110.html
iOS开发 移动开发 POI