public class GLSearch
extends com.getyourmap.glmap.GLNativeObject
GLSearchOffline contains a set of parameters that defines search in offline maps| Modifier and Type | Class and Description |
|---|---|
static interface |
GLSearch.GLMapSearchCompletion |
| Constructor and Description |
|---|
GLSearch() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCategoryFilter(GLSearchCategory category)
Adds category filter.
|
void |
addNameFilter(java.lang.String word)
Adds name filter (name of object contains word)
|
void |
addNamesFilter(java.lang.String[] words)
Adds name filter (name of object contains ANY of word in array).
|
void |
addTagFilter(java.lang.String tag,
java.lang.String[] values)
Adds custom filter by tag (value of tag exactly matches to one of given values)
|
void |
cancel()
Cancels search operation.
|
static GLSearchCategory |
getSearchCategory(com.getyourmap.glmap.GLMapVectorObject object)
Detects category for vector object
|
static void |
Initialize(android.content.Context context)
Call this method before using any other method from `com.getyourmap.glsearch`
|
static com.getyourmap.glmap.GLMapVectorObject |
mapObjectNearPoint(com.getyourmap.glmap.GLMapView mapView,
com.getyourmap.glmap.MapPoint point,
double maxDistance)
Returns object near point on map
|
void |
setBBox(com.getyourmap.glmap.GLMapBBox bbox)
Sets bounding box where search will be performed
|
void |
setCenter(com.getyourmap.glmap.MapPoint center)
Sets center of search.
|
void |
setLimit(int limit)
Sets maximum number of results to fetch from map
|
void |
setLocaleSettings(com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
Sets locale settings that used to sort results by importance.
|
void |
start(java.util.List customObjects,
GLSearch.GLMapSearchCompletion callback)
Starts search.
|
public static void Initialize(android.content.Context context)
context - context needed to load icu and categories datapublic static com.getyourmap.glmap.GLMapVectorObject mapObjectNearPoint(com.getyourmap.glmap.GLMapView mapView,
com.getyourmap.glmap.MapPoint point,
double maxDistance)
mapView - Map viewpoint - Point on mapmaxDistance - Distance in pointspublic static GLSearchCategory getSearchCategory(com.getyourmap.glmap.GLMapVectorObject object)
object - Vector objectpublic void addNameFilter(java.lang.String word)
word - Word querypublic void addNamesFilter(java.lang.String[] words)
words - Array of wordspublic void setLocaleSettings(com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
localeSettings - Language priority settings.public void addCategoryFilter(GLSearchCategory category)
category - Category objectpublic void addTagFilter(java.lang.String tag,
java.lang.String[] values)
tag - Tag. e.g. "amenity"values - Array of values. e.g. ["bar", "pub"]public void setLimit(int limit)
limit - Results limitpublic void setBBox(com.getyourmap.glmap.GLMapBBox bbox)
bbox - Search bounding box.public void setCenter(com.getyourmap.glmap.MapPoint center)
center - Center point.public void start(java.util.List customObjects,
GLSearch.GLMapSearchCompletion callback)
customObjects - Custom object to add to resultscallback - will be called when search is finished or when search needs information about custom object.public void cancel()
Copyright © 2018 GetYourMap. All Rights Reserved.