2 #include "maps_test_geocode.h"
3 #include "maps_test_log.h"
4 #include "maps_test_util.h"
11 static void cleanup(bool result)
19 * callback functions for APIs
23 static bool __maps_test_geocode_cb(maps_error_e error, int request_id,
24 int index, int total, maps_coordinates_h coord, void *user_data)
27 LOG_START_TITLE("%s [%d/%d] ", (user_data ? (char*)user_data : __FUNCTION__), MIN(index+1, total), total);
30 LOGD("error=%d", error);
35 log_coordinates("", "Geocoding", coord);
36 maps_coordinates_destroy(coord);
39 if (index == total - 1)
44 int maps_test_geocode(maps_service_h maps_svc)
47 int request_id = 0, error;
49 error = maps_service_geocode(maps_svc, "Berlin", maps_pref, __maps_test_geocode_cb, "Geocoding with Berlin", &request_id);
51 if (error != MAPS_ERROR_NONE)
56 static void __maps_test_reverse_geocode_cb(maps_error_e error, int request_id,
57 int index, int total, maps_address_h address, void *user_data)
60 LOG_START_TITLE("%s [%d/%d] ", (user_data ? (char*)user_data : __FUNCTION__), MIN(index+1, total), total);
63 LOGD("error=%d", error);
68 log_address("", address);
69 maps_address_destroy(address);
72 if (index == total - 1)
76 int maps_test_reverse_geocode(maps_service_h maps_svc)
79 int request_id = 0, error;
81 error = maps_service_reverse_geocode(maps_svc, 12.944594, 77.554303, maps_pref,
82 __maps_test_reverse_geocode_cb, "Reverse-geocoding with [12.944594, 77.554303]", &request_id);
84 if (error != MAPS_ERROR_NONE)