Git Product home page Git Product logo

wechatnearbylocationdemo's Introduction

仿微信获取附近的地标

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

wechatnearbylocationdemo's People

Contributors

corzfree avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.