MapKit Mobile SDK

Warning

This feature is available in the Full MapKit SDK version

MMKSearchManager

class MMKSearchManager : NSObject

Main interface to start search.

Summary

Instance methods

func submit(withText text: String,
                 geometry: MMKGeometry,
            searchOptions: MMKSearchOptions,
          responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession
Search request for searching a user query near given geometry

func submit(withText text: String,
                 polyline: MMKPolyline,
                 geometry: MMKGeometry,
            searchOptions: MMKSearchOptions,
          responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession
Search request that is used to search for a user query along the given polyline inside the given window

func submit(with point: MMKPoint,
                  zoom: NSNumber?,
         searchOptions: MMKSearchOptions,
       responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession
Reverse search request (to search objects at the given coordinates)

func resolveURI(withUri uri: String,
              searchOptions: MMKSearchOptions,
            responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession
Search request for URI resolution

func searchByURI(withUri uri: String,
               searchOptions: MMKSearchOptions,
             responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession
Search request with URI

func createSuggestSession() -> MMKSearchSuggestSession
Creates session for suggest requests

Instance methods

submit(withText:geometry:searchOptions:responseHandler:)

func submit(withText text: String,
                 geometry: MMKGeometry,
            searchOptions: MMKSearchOptions,
          responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession

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.


submit(withText:polyline:geometry:searchOptions:responseHandler:)

func submit(withText text: String,
                 polyline: MMKPolyline,
                 geometry: MMKGeometry,
            searchOptions: MMKSearchOptions,
          responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession

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

@link search.Session#setSortByDistance(const mapkit.geometry.Geometry)} is assumed on the first request. - parameter: 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. - parameter: searchOptions Various additional search parameters, see MMKSearchOptions definition for details. - parameter: 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.

Parameters

text

User query.

polyline

Polyline to search near; {


submit(with:zoom:searchOptions:responseHandler:)

func submit(with point: MMKPoint,
                  zoom: NSNumber?,
         searchOptions: MMKSearchOptions,
       responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession

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.


resolveURI(withUri:searchOptions:responseHandler:)

func resolveURI(withUri uri: String,
              searchOptions: MMKSearchOptions,
            responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession

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.


searchByURI(withUri:searchOptions:responseHandler:)

func searchByURI(withUri uri: String,
               searchOptions: MMKSearchOptions,
             responseHandler: @escaping MMKSearchSessionResponseHandler) -> MMKSearchSession

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()

func createSuggestSession() -> MMKSearchSuggestSession

Creates session for suggest requests.