Warning

This feature is available in the Full MapKit SDK version

MMKSearchSession

@interface MMKSearchSession : NSObject

Interface denoting ongoing search session. Allows search cancellation and retry. For many request types allows further searches.

Summary

Instance methods

- (void)cancel;
Cancels the current request

- (void)retryWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Retries the last request

- (BOOL)hasNextPage;
Check the availability of the next result page

- (void)fetchNextPageWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Request the next page of search results

- (void)setFiltersWithFilters:
    (nonnull NSArray<MMKSearchBusinessFilter *> *)filters;

Undocumented

- (void)setSortByDistanceWithOrigin:(nonnull MMKGeometry *)origin;
Requests sorting by distance for future resubmits

- (void)resetSort;
Resets the sort if it was previously set (for example by MMKSearchSession::setSortByDistanceWithOrigin:) for future resubmits

- (void)setSearchAreaWithArea:(nonnull MMKGeometry *)area;
Sets the search area for future resubmits

- (void)setSearchOptionsWithSearchOptions:
    (nonnull MMKSearchOptions *)searchOptions;

Set searchOptions for future resubmits

- (void)resubmitWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Redo the last search with currently set values of search area, search options, filters, sort type and sort origin

Instance methods

cancel

- (void)cancel;

Cancels the current request.


retryWithResponseHandler:

- (void)retryWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Retries the last request. If there is an active request, it is cancelled.

Parameters

searchListener

Listener to handle search result.


hasNextPage

- (BOOL)hasNextPage;

Check the availability of the next result page.

Returns

True if there are more search results and one can call
MMKSearchSession::fetchNextPageWithResponseHandler:, false otherwise.


fetchNextPageWithResponseHandler:

- (void)fetchNextPageWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Request the next page of search results. Ignored if the current request isn't ready. Will throw if called when MMKSearchSession::hasNextPage is false.

Parameters

searchListener

Listener to handle search result.


setFiltersWithFilters:

- (void)setFiltersWithFilters:
    (nonnull NSArray<MMKSearchBusinessFilter *> *)filters;

Undocumented

Alert

Use {@link SearchOptions#filters} instead.


setSortByDistanceWithOrigin:

- (void)setSortByDistanceWithOrigin:(nonnull MMKGeometry *)origin;

Requests sorting by distance for future resubmits. Supported geometry types: point, polyline.

Parameters

origin

Origin to sort by distance from.


resetSort

- (void)resetSort;

Resets the sort if it was previously set (for example by MMKSearchSession::setSortByDistanceWithOrigin:) for future resubmits.


setSearchAreaWithArea:

- (void)setSearchAreaWithArea:(nonnull MMKGeometry *)area;

Sets the search area for future resubmits. Supported geometry types: bounding box, polyline, polygon. Polygon is expected to be a search window: 4 points in outer ring (or 5 if last point is equal to first) and no inner rings.

Parameters

area

Search area for future resubmits.


setSearchOptionsWithSearchOptions:

- (void)setSearchOptionsWithSearchOptions:
    (nonnull MMKSearchOptions *)searchOptions;

Set searchOptions for future resubmits.

Parameters

searchOptions

Additional search parameters, see MMKSearchOptions. Supported options: MMKSearchOptions::origin, MMKSearchOptions::userPosition.


resubmitWithResponseHandler:

- (void)resubmitWithResponseHandler:
    (nonnull MMKSearchSessionResponseHandler)responseHandler;

Redo the last search with currently set values of search area, search options, filters, sort type and sort origin. Isn't applicable to reverse geosearch and URI resolving. Ignored it the current request is the first one; cancels current request otherwise.

Parameters

searchListener

Listener to handle search result.