summaryrefslogtreecommitdiff
path: root/tests/address-sample.c
diff options
context:
space:
mode:
authorGenie Kim <daejins.kim@samsung.com>2013-05-08 22:03:35 +0900
committerGenie Kim <daejins.kim@samsung.com>2013-05-08 22:03:35 +0900
commit1740e7d3430d0c3eefe36b461803f821f03a0ced (patch)
tree9901e735eda185a23bcc320e07cc1102c956d6c6 /tests/address-sample.c
parentf7d2520a9623b02c158ff231297d1ac14a123661 (diff)
downloadlibslp-location-1740e7d3430d0c3eefe36b461803f821f03a0ced.tar.gz
libslp-location-1740e7d3430d0c3eefe36b461803f821f03a0ced.tar.bz2
libslp-location-1740e7d3430d0c3eefe36b461803f821f03a0ced.zip
Diffstat (limited to 'tests/address-sample.c')
-rw-r--r--tests/address-sample.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/address-sample.c b/tests/address-sample.c
index 8b155fc..add8846 100644
--- a/tests/address-sample.c
+++ b/tests/address-sample.c
@@ -21,6 +21,7 @@
#include <gconf/gconf-client.h>
#include <location.h>
+#include <location-geocode.h>
#include <location-map-service.h>
static GMainLoop *loop = NULL;
@@ -125,26 +126,31 @@ cb_service_enabled (GObject *self,
static gboolean
async_request (gpointer loc)
{
+ guint req_id = 0;
+ LocationGeocodePreference *pref =location_geocode_pref_new();
+ location_geocode_pref_set_max_result(pref, 25);
+
LocationAddress *addr = location_address_new ("1", "Post Street", NULL, "san jose", "ca", NULL, "95113",NULL,NULL,NULL);
- LocationError err = location_map_get_position_from_address_async(loc, addr, cb_position_from_address, loc);
+ LocationError err = location_map_get_position_from_address_async(loc, addr,pref, cb_position_from_address, loc,&req_id);
if (LOCATION_ERROR_NONE == err)
g_debug("location_map_get_position_from_address_async() success");
else g_warning ("location_map_get_position_from_address_async() failed> error code:%d", err);
location_address_free (addr);
gchar *addr_str = g_strdup("4 N 2nd Street 95113");
- err = location_map_get_position_from_freeformed_address_async(loc, addr_str, cb_position_from_freeformed_address, loc);
+ err = location_map_get_position_from_freeformed_address_async(loc, addr_str,pref, cb_position_from_freeformed_address, loc,&req_id);
if (LOCATION_ERROR_NONE == err)
g_debug("location_map_get_position_from_freeformed_address_async() success");
else g_warning ("location_map_get_position_from_freeformed_address_async() failed> error code:%d", err);
g_free(addr_str);
LocationPosition *pos = location_position_new (0, 37.3322, -121.8720, 0, LOCATION_STATUS_2D_FIX);
- err = location_map_get_address_from_position_async(loc, pos, cb_address_from_position, loc);
+ err = location_map_get_address_from_position_async(loc, pos,cb_address_from_position, loc,&req_id);
if (LOCATION_ERROR_NONE == err)
g_debug("location_map_get_address_from_position_async() success");
else g_warning ("location_map_get_address_from_position_async() failed> error code:%d", err);
location_position_free (pos);
+ location_geocode_pref_free(pref);
return FALSE;
}