Warning

This feature is available in the Full MapKit SDK version

MMKSearchManager

@interface MMKSearchManager : NSObject

Main interface to start search.

Summary

Instance methods

- (nonnull MMKSearchSession *)
     submitWithText:(nonnull NSString *)text
           geometry:(nonnull MMKGeometry *)geometry
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request for searching a user query near given geometry

- (nonnull MMKSearchSession *)
     submitWithText:(nonnull NSString *)text
           polyline:(nonnull MMKPolyline *)polyline
           geometry:(nonnull MMKGeometry *)geometry
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request that is used to search for a user query along the given polyline inside the given window

- (nonnull MMKSearchSession *)
    submitWithPoint:(nonnull MMKPoint *)point
               zoom:(nullable NSNumber *)zoom
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Reverse search request (to search objects at the given coordinates)

- (nonnull MMKSearchSession *)
    resolveURIWithUri:(nonnull NSString *)uri
        searchOptions:(nonnull MMKSearchOptions *)searchOptions
      responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request for URI resolution

- (nonnull MMKSearchSession *)
    searchByURIWithUri:(nonnull NSString *)uri
         searchOptions:(nonnull MMKSearchOptions *)searchOptions
       responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request with URI

- (nonnull MMKSearchSuggestSession *)createSuggestSession;
Creates session for suggest requests

Instance methods

submitWithText:geometry:searchOptions:responseHandler:

- (nonnull MMKSearchSession *)
     submitWithText:(nonnull NSString *)text
           geometry:(nonnull MMKGeometry *)geometry
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request for searching a user query near given geometry.

Parameters

text

User query.

geometry

Geometry to search near. Supported types: point, bounding box, polyline and polygon. If the polyline is provided, setSortByDistance(polyline) is assumed on the first request. Polygon is expected to be a search window: 4 points in outer ring (or 5 if the last point is equal to the first) and no inner rings.

searchOptions

Various additional search parameters, see MMKSearchOptions definition for details.

searchListener

Listener to handle search result.

Returns

MMKSearchSession which allows further searches, cancel and
retry.


submitWithText:polyline:geometry:searchOptions:responseHandler:

- (nonnull MMKSearchSession *)
     submitWithText:(nonnull NSString *)text
           polyline:(nonnull MMKPolyline *)polyline
           geometry:(nonnull MMKGeometry *)geometry
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request that is used to search for a user query along the given polyline inside the given window.

Parameters

text

User query.

polyline

Polyline to search near; MMKSearchSession::setSortByDistanceWithOrigin: is assumed on the first request.

geometry

Geometry to search near; supported types: point, bounding box, polyline and polygon. Polygon is expected to be a search window: 4 points in outer ring (or 5 if the last point is equal to first) and no inner rings.

searchOptions

Various additional search parameters, see MMKSearchOptions definition for details.

searchListener

Listener to handle search result.

Returns

MMKSearchSession which allows further searches, cancel and
retry. Session should be stored by user or search is automatically
cancelled.


submitWithPoint:zoom:searchOptions:responseHandler:

- (nonnull MMKSearchSession *)
    submitWithPoint:(nonnull MMKPoint *)point
               zoom:(nullable NSNumber *)zoom
      searchOptions:(nonnull MMKSearchOptions *)searchOptions
    responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Reverse search request (to search objects at the given coordinates)

Parameters

point

Coordinates to search at.

zoom

Current zoom level. Skips objects that are too small for a given zoom level.

searchOptions

Additional search parameters, see MMKSearchOptions definition for details. Currently the only supported options are MMKSearchOptions::origin, MMKSearchOptions::searchTypes and MMKSearchOptions::snippets. Only 'geo' and 'biz' types are supported and not at the same time.

searchListener

Listener to handle search result.

Returns

MMKSearchSession which allows further searches, cancel and
retry. Session should be stored by user or search is automatically
cancelled.


resolveURIWithUri:searchOptions:responseHandler:

- (nonnull MMKSearchSession *)
    resolveURIWithUri:(nonnull NSString *)uri
        searchOptions:(nonnull MMKSearchOptions *)searchOptions
      responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request for URI resolution.

Parameters

uri

Object uri.

searchOptions

Additional search parameters, see MMKSearchOptions definition for details. Currently the only supported options are MMKSearchOptions::origin and MMKSearchOptions::snippets.

searchListener

Listener to handle search result.

Returns

MMKSearchSession which allows search cancel and retry. Should
be stored by user or search is automatically cancelled.


searchByURIWithUri:searchOptions:responseHandler:

- (nonnull MMKSearchSession *)
    searchByURIWithUri:(nonnull NSString *)uri
         searchOptions:(nonnull MMKSearchOptions *)searchOptions
       responseHandler:(nonnull MMKSearchSessionResponseHandler)responseHandler;

Search request with URI. Allows multiple results in response.

Parameters

uri

Object uri.

searchOptions

Additional search parameters, see MMKSearchOptions definition for details. Currently the only supported options are MMKSearchOptions::origin, MMKSearchOptions::snippets and. MMKSearchOptions::resultPageSize.

searchListener

Listener to handle search result.

Returns

MMKSearchSession which allows search cancel and retry. Should
be stored by user or search is automatically cancelled.


createSuggestSession

- (nonnull MMKSearchSuggestSession *)createSuggestSession;

Creates session for suggest requests.