W3WSearchEngine (API Reference)
Class W3WSearchEngine
what3words is an alternative geocode system designed to identify any location on the planet.
The system divides the world into a grid of 57 trillion 3-by-3-metre squares, each of which
has a three-word address. For example, the front door of HERE’s Berlin office is identified by
"///wage.mere.heap".
W3WSearchEngine allows you to convert 3 word addresses to coordinates and also coordinates
to 3 word addresses.
Note: Using W3WSearchEngine requires a licence to access HERE what3words APIs.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this class.W3WSearchEngine(SDKNativeEngine sdkEngine) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionsearch(GeoCoordinates coordinates, String language, W3WSearchCallback callback) Performs an asynchronous request to search for aW3WSquare, which includes the 3 word address, that corresponds to the given coordinates.search(String words, W3WSearchCallback callback) Performs an asynchronous request to search for aW3WSquarethat corresponds to the given 3 words.
-
Constructor Details
-
W3WSearchEngine
Creates a new instance of this class.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
W3WSearchEngine
Creates a new instance of this class.
- Parameters:
sdkEngine-Instance of an existing SDKEngine.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
-
Method Details
-
search
Performs an asynchronous request to search for a
W3WSquarethat corresponds to the given 3 words.- Parameters:
words-A 3 word address as a string. It must be three words separated with dots or a japanese middle dot character (・). Words separated by spaces will be rejected. Optionally, the 3 word address can be prefixed with ///.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that can be used to manipulate the execution of the task.
-
search
@NonNull public TaskHandle search(@NonNull GeoCoordinates coordinates, @Nullable String language, @NonNull W3WSearchCallback callback) Performs an asynchronous request to search for a
W3WSquare, which includes the 3 word address, that corresponds to the given coordinates.- Parameters:
coordinates-The coordinates where to search.
language-A supported 3 word address language as an ISO 639-1 2 letter code. For Bosnian-Croatian-Montenegrin-Serbian use "oo". Defaults to "en" (English).
callback-Callback which receives the result on the main thread.
- Returns:
Handle that can be used to manipulate the execution of the task.
-