Важно

This feature is available in the Full MapKit SDK version

YMKSearchSession

class YMKSearchSession : NSObject

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

Summary

Instance methods

func cancel()
Cancels the current request

func retry(responseHandler: @escaping YMKSearchSessionResponseHandler)
Retries the last request

func hasNextPage() -> Bool
Check the availability of the next result page

func fetchNextPage(responseHandler: @escaping YMKSearchSessionResponseHandler)
Request the next page of search results

func setFiltersWith( filters: [YMKSearchBusinessFilter_])
Undocumented

func setSortByDistanceWithOrigin( origin: YMKGeometry_)
Requests sorting by distance for future resubmits

func resetSort()
Resets the sort if it was previously set (for example by YMKSearchSession::setSortByDistanceWithOrigin:) for future resubmits

func setSearchAreaWithArea( area: YMKGeometry_)
Sets the search area for future resubmits

func setSearchOptionsWith( searchOptions: YMKSearchOptions_)
Set searchOptions for future resubmits

func resubmit(responseHandler: @escaping YMKSearchSessionResponseHandler)
Redo the last search with currently set values of search area, search options, filters, sort type and sort origin

Instance methods

cancel()

func cancel()

Cancels the current request.


retry(responseHandler:)

func retry(responseHandler: @escaping YMKSearchSessionResponseHandler)

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

Parameters

searchListener

Listener to handle search result.


hasNextPage()

func hasNextPage() -> Bool

Check the availability of the next result page.

Returns

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


fetchNextPage(responseHandler:)

func fetchNextPage(responseHandler: @escaping YMKSearchSessionResponseHandler)

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

Parameters

searchListener

Listener to handle search result.


setFiltersWith(_:)

func setFiltersWith( filters: [YMKSearchBusinessFilter_])

Undocumented

Внимание

Use {@link SearchOptions#filters} instead.


setSortByDistanceWithOrigin(_:)

func setSortByDistanceWithOrigin( origin: YMKGeometry_)

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

Parameters

origin

Origin to sort by distance from.


resetSort()

func resetSort()

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


setSearchAreaWithArea(_:)

func setSearchAreaWithArea( area: YMKGeometry_)

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.


setSearchOptionsWith(_:)

func setSearchOptionsWith( searchOptions: YMKSearchOptions_)

Set searchOptions for future resubmits.

Parameters

searchOptions

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


resubmit(responseHandler:)

func resubmit(responseHandler: @escaping YMKSearchSessionResponseHandler)

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.


Предыдущая
Следующая