Perform a geocode search.
#include <geo_search.h>
geo_search_error_t geo_search_geocode(geo_search_handle_t *handle, geo_search_reply_t *reply, const char *search_string)
BlackBerry 10.0.0
A geo_search handle.
A reply handle.
A null-terminated free format search string (UTF-8).
Given a free form string specifying a location, this function provides a reply containing one or more matching results. If the location specified is a complete street address the reply may contain only one result. If the location given is less specific (e.g. "Springfield") then there may be multiple results in the reply. Note that searching for local or obscure names may provide no results at all (this function returns GEO_SEARCH_ERROR_SERVER_EMPTY). In such cases it may help to provide a geographic coordinate (latitude, longitude) as a hint using geo_search_geocode_latlon() instead.
Note that this function may make a network request and blocks until the remote server responds.
geo_search_handle_t handle; geo_search_error_t error = geo_search_open( &handle ); if ( error == GEO_SEARCH_OK ) { geo_search_reply_t reply; const char *search_string = "Springfield"; error = geo_search_geocode(&handle, &reply, search_string); if ( error == GEO_SEARCH_OK ) { // do something with the results in the search reply geo_search_free_reply( &reply ); } geo_search_close( &handle ); }
See geo_search_reply_get_name() for an example of how to access the results in a search reply.
GEO_SEARCH_OK if successful, otherwise one of the values from geo_search_error_t.