Warning

This feature is available in the Full MapKit SDK version

Package world.mappable.mapkit.search

Interface Session

interface Session

Interface denoting ongoing search session.

Allows search cancellation and retry. For many request types allows further searches.

Summary

Methods

Type and modifiers

Method and Description

void

cancel()
Cancels the current request.

void

retry(@NonNull SearchListener searchListener)
Retries the last request.

boolean

hasNextPage()
Check the availability of the next result page.

void

fetchNextPage(@NonNull SearchListener searchListener)
Request the next page of search results.

void

setFilters(@NonNull java.util.List<BusinessFilter> filters)

void

setSortByDistance(@NonNull Geometry origin)
Requests sorting by distance for future resubmits.

void

resetSort()
Resets the sort if it was previously set (for example by mapkit.search.Session#setSortByDistance(Geometry)) for future resubmits.

void

setSearchArea(@NonNull Geometry area)
Sets the search area for future resubmits.

void

setSearchOptions(@NonNull SearchOptions searchOptions)
Set searchOptions for future resubmits.

void

resubmit(@NonNull SearchListener searchListener)
Redo the last search with currently set values of search area, search options, filters, sort type and sort origin.

Methods

cancel

void cancel()

Cancels the current request.


retry

void retry(@NonNull SearchListener searchListener)

Retries the last request.

If there is an active request, it is cancelled.

Parameters

searchListener

Listener to handle search result.


hasNextPage

boolean hasNextPage()

Check the availability of the next result page.

Returns

True if there are more search results and one can call mapkit.search.Session#fetchNextPage(SearchListener), false otherwise.


fetchNextPage

void fetchNextPage(@NonNull SearchListener searchListener)

Request the next page of search results.

Ignored if the current request isn't ready. Will throw if called when mapkit.search.Session#hasNextPage() is false.

Parameters

searchListener

Listener to handle search result.


setFilters

@Deprecated
void setFilters(@NonNull java.util.List<BusinessFilter> filters)

Alert

Use SearchOptions#filters instead.


setSortByDistance

void setSortByDistance(@NonNull Geometry 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 mapkit.search.Session#setSortByDistance(Geometry)) for future resubmits.


setSearchArea

void setSearchArea(@NonNull Geometry 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.


setSearchOptions

void setSearchOptions(@NonNull SearchOptions searchOptions)

Set searchOptions for future resubmits.

Parameters

searchOptions

Additional search parameters, see mapkit.search.SearchOptions. Supported options: mapkit.search.SearchOptions#origin, mapkit.search.SearchOptions#userPosition.


resubmit

void resubmit(@NonNull SearchListener searchListener)

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.