Location:

Charging Station Search

Keyword Search

1. Import header files

                    #import <NavinfoKit/NavinfoKit.h>
                

2. Configure APIKEY

Refer to Project Configuration Instructions.

3. Define NavinfoPOISearch

Define the main search object NavinfoPOISearch and inherit the search protocol <NavinfoQueryDelegate >.

4. Construct NavinfoPOISearch

Construct a search object NavinfoPOISearch and set the proxy.

                    self.search = [[NavinfoPOISearch alloc] init];
                    self.search.delegate = self;
                

5. Set keyword charging pile search query parameters

The request parameter class of the keyword charging pile search query is NavinfoPOIQuery, and the keyword (keyword) and category (search type) are mandatory parameters.

Keyword charging pile search category is SERVICE_API_EV_TEXT.

                    Self.query = [[NavinfoPOIQuery alloc] initWithKeyword:@"petrol station" city:nil lonlats:nil category: SERVICE_API_EV_TEXT];
                

6. Initiate keyword charging pile search query parameters

Initiate a keyword charging stub search query by calling the search method of NavinfoPOISearch.

                    [_incidentSearch search:query];
                

7. Processing data in callbacks

When the query is successful, it will go to the POISearch:result:error callback function. Through the callback function, you can get the result of the query keyword charging pile search.

                    - (void)POISearch:(NavinfoPOISearch *)poiSearch 
                    result:(NavinfoPOISearchResult *)
                    result error:(NSError *)error;
                

Description:

1) Get the total number of results retrieved by result. total.

2) Get a list of province distribution results by result. provinces. See NavinfoProvince for details.

3) Get a list of POI information via result pois. Refer to NavinfoPOI for details.

4) Obtain administrative area switching information by result. See NavinfoDistrict for details.

8. Processing failed queries

When the retrieval fails, Error returns, and the reason for the failure is obtained by the callback function.

Circular Search

Refer to the keyword charging pile search in detail, the different settings are as follows:

5. Set round charging pile search query parameters

The request parameter class of the circular charging pile search query is NavinfoPOIQuery, lonlat (current coordinate point) and category (search type) are mandatory parameters.

Keyword charging pile search category is SERVICE_API_EV_TEXT.

                    self.query = [[NavinfoPOIQuery alloc] initWithKeyword:nil city:nil lonlats:[NavinfoLonlat toLonlatsWithLonlatStrings:@"116.311050,39.980570"] category: SERVICE_API_EV_AROUND];
                

Polygon Search

Refer to the keyword charging pile search in detail, the different settings are as follows:

5. Set polygon charging pile search query parameters

The request parameter class of the polygon charging pile search query is NavinfoPOIQuery, lonlats (polygon string), category (search type) is a mandatory parameter.

Rectangle search category is SERVICE_API_EV_POLYGON.

                    NSString *lonlatString = @"116.311050,39.980570;116.310880,39.945280;116.335770,39.926260;116.359210,39.923100";
                    self.query = [[NavinfoPOIQuery alloc] initWithKeyword:nil city:nil lonlats:[NavinfoLonlat toLonlatsWithLonlatStrings:lonlatString]
                    category: SERVICE_API_EV_POLYGON];
                

Search Along the Way

Refer to the keyword charging pile search in detail, the different settings are as follows:

5. Set the search parameters for charging piles along the way

The request parameter class of the charging pile search query along the way is NavinfoPOIQuery, lonlats (polygon coordinate string), category (search type) is a mandatory parameter.

The charging pile search category along the way is SERVICE_API_EV_LINE.

                    NSString *lonlatString = @"116.311050,39.980570;116.310880,39.945280;116.335770,39.926260;116.359210,39.923100";
                    self.query = [[NavinfoPOIQuery alloc] initWithKeyword:nil city:nil lonlats:[NavinfoLonlat toLonlatsWithLonlatStrings:lonlatString]
                        category: SERVICE_API_EV_LINE];
                

Details Query

Refer to the keyword location details search in detail, the different settings are as follows:

5. Set the search parameters for charging piles along the way

Details The request parameter class for the charging stub search query is NavinfoDetailsQuery, poiEVIds (POI unique id), and category (search type) are mandatory parameters.

Details Charge the pile search category to SERVICE_API_EV_DETAIL.

                    self.detailQuery = [[NavinfoDetailsQuery alloc] init];
                    self.detailQuery.category = SERVICE_API_EV_DETAIL;
                
TOP