public class

VectorTileSearchService

extends Object
java.lang.Object
   ↳ com.carto.search.VectorTileSearchService

Class Overview

A search service for finding features from the specified vector tile data source.
Depending on the datasource, searching may perform network requests and must be executed in non-UI background thread.

Summary

Public Constructors
VectorTileSearchService(TileDataSource dataSource, VectorTileDecoder tileDecoder)
Constructs a VectorTileSearchService for the given vector data source and vector tile decoder.
Public Methods
synchronized void delete()
VectorTileFeatureCollection findFeatures(SearchRequest request)
Searches for the features specified by search request from the vector tiles bound to the service.
TileDataSource getDataSource()
Returns the tile data source of the search service.
int getMaxResults()
Returns the maximum number of results the search service returns.
int getMaxZoom()
Returns the maximum zoom level of vector tiles used.
int getMinZoom()
Returns the minimum zoom level of vector tiles used.
VectorTileDecoder getTileDecoder()
Returns the tile decoder used by the search service.
void setMaxResults(int maxResults)
Sets the maximum number of results the search service returns.
void setMaxZoom(int maxZoom)
Sets the maximum zoom level of vector tiles used.
void setMinZoom(int minZoom)
Sets the minimum zoom level of vector tiles used.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public VectorTileSearchService (TileDataSource dataSource, VectorTileDecoder tileDecoder)

Constructs a VectorTileSearchService for the given vector data source and vector tile decoder.

Parameters
dataSource The vector data source to search from.
tileDecoder The vector tile decoder to use for decoding the tiles.

Public Methods

public synchronized void delete ()

public VectorTileFeatureCollection findFeatures (SearchRequest request)

Searches for the features specified by search request from the vector tiles bound to the service.
The zoom level range used for searching is specified using minZoom/maxZoom attributes of the search service.
Depending on the data source, this method may perform slow IO operations and may need to be run in background thread.

Parameters
request The search request containing search filters.
Returns
  • The resulting feature collection containing features matching the request.

public TileDataSource getDataSource ()

Returns the tile data source of the search service.

Returns
  • The tile data source of the search service.

public int getMaxResults ()

Returns the maximum number of results the search service returns.

Returns
  • The maximum number of results the search service returns.

public int getMaxZoom ()

Returns the maximum zoom level of vector tiles used.
By default the maximum zoom level is specified by data source.

Returns
  • The maximum zoom level of vector tiles used.

public int getMinZoom ()

Returns the minimum zoom level of vector tiles used.
By default the minimum zoom level is specified by data source and is usually 0.

Returns
  • The minimum zoom level of vector tiles used.

public VectorTileDecoder getTileDecoder ()

Returns the tile decoder used by the search service.

Returns
  • The tile decoder used by the search service.

public void setMaxResults (int maxResults)

Sets the maximum number of results the search service returns.
The default number of results is 1000.

Parameters
maxResults The new maximum number of results the geocoding service returns.

public void setMaxZoom (int maxZoom)

Sets the maximum zoom level of vector tiles used.

Parameters
maxZoom The new maximum zoom level.

public void setMinZoom (int minZoom)

Sets the minimum zoom level of vector tiles used.

Parameters
minZoom The new minimum zoom level.