@ParametersAreNonnullByDefault
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.AddressStyle |
static interface |
GLSearch.GLSearchCallback
Callback that provides information for custom objects for search.
|
static interface |
GLSearch.MatchType |
static interface |
GLSearch.Type |
| Constructor and Description |
|---|
GLSearch()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(GLSearchFilter filter)
Adds filter to search.
|
void |
cancel()
Cancels search operation.
|
static int |
Collate(long collator,
java.lang.String a,
java.lang.String b)
Compare to string with collator
|
static long |
CreateCollator()
Creates ICU collator with strength set to Primary.
|
static long |
CreateNumericCollator()
Creates ICU collator with strength set to Primary and numeric collation is ON.
|
static void |
DestroyCollator(long collator)
Destroy collator
|
static void |
DestroyWords(long words)
Destroy native object returned by GLSearch#PrepareWords(long, String[]).
|
static com.getyourmap.glmap.GLMapValue |
FindWords(long collator,
java.lang.String string,
long words)
Split string into words.
|
static com.getyourmap.glmap.GLMapValue |
GetAddress(com.getyourmap.glmap.GLMapVectorObject object,
int style,
com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
Returns address with given style
|
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.GLMapValue[] |
LocalizedAddressNames(com.getyourmap.glmap.GLMapVectorObject object,
com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
Returns all address names associated with object
|
static com.getyourmap.glmap.GLMapVectorObject |
MapObjectNearPoint(com.getyourmap.glmap.GLMapView mapView,
com.getyourmap.glmap.MapPoint point,
double maxDistance)
Returns object near point on map
|
static android.util.SparseArray<com.getyourmap.glmap.GLMapValue> |
MatchedCategoryTags(com.getyourmap.glmap.GLMapVectorObject object) |
static long |
PrepareWords(long collator,
java.lang.String[] words)
Prepares words for collation
|
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 |
setNeedEnclosingAreas(boolean needEnclosingAreas)
Set this value to `YES` if you plan to get address of objects.
|
void |
setObjectTypes(int objectTypes)
Set object types
|
void |
setSearchType(int type)
Set search type.
|
void |
setTiles(long[] tiles)
Adds tile hashes to use for search (child tiles will be skipped)
|
static java.lang.String[] |
SplitByWords(java.lang.String string)
Split string into words using ICU root rules
|
void |
start(java.util.List customObjects,
GLSearch.GLSearchCallback 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 points@Nullable public static GLSearchCategory GetSearchCategory(com.getyourmap.glmap.GLMapVectorObject object)
object - Vector object@Nullable public static android.util.SparseArray<com.getyourmap.glmap.GLMapValue> MatchedCategoryTags(com.getyourmap.glmap.GLMapVectorObject object)
@Nullable
public static com.getyourmap.glmap.GLMapValue GetAddress(com.getyourmap.glmap.GLMapVectorObject object,
int style,
com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
object - vector objectstyle - style of addresslocaleSettings - locale settings@Nullable
public static com.getyourmap.glmap.GLMapValue[] LocalizedAddressNames(com.getyourmap.glmap.GLMapVectorObject object,
com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
object - vector objectlocaleSettings - Locale settings used to find name@NonNull public static java.lang.String[] SplitByWords(java.lang.String string)
string - string to split into wordspublic static long PrepareWords(long collator,
java.lang.String[] words)
collator - collator that will be used in collationwords - words to preparepublic static void DestroyWords(long words)
words - native object@Nullable
public static com.getyourmap.glmap.GLMapValue FindWords(long collator,
java.lang.String string,
long words)
collator - collator to usestring - string where prepared words will be checkedwords - prepared wordspublic static long CreateCollator()
public static long CreateNumericCollator()
public static void DestroyCollator(long collator)
collator - native collator objectpublic static int Collate(long collator,
java.lang.String a,
java.lang.String b)
collator - collator to usea - the first object to be compared.b - the second object to be compared.public void setTiles(long[] tiles)
tiles - Array of tile hashes
public native void setTiles(long tiles[]);public void setLocaleSettings(com.getyourmap.glmap.GLMapLocaleSettings localeSettings)
localeSettings - Language priority settings.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 addFilter(GLSearchFilter filter)
filter - filter to add.public void setNeedEnclosingAreas(boolean needEnclosingAreas)
needEnclosingAreas - if `YES` search will load enclosing areas.public void setSearchType(int type)
type - type of searchpublic void setObjectTypes(int objectTypes)
objectTypes - object typespublic void start(@Nullable
java.util.List customObjects,
GLSearch.GLSearchCallback 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.