Remove support for place_details api 79/93179/1
authorVarun <tallytalwar@gmail.com>
Thu, 20 Oct 2016 19:10:33 +0000 (15:10 -0400)
committerVarun <tallytalwar@gmail.com>
Thu, 20 Oct 2016 19:10:33 +0000 (15:10 -0400)
Change-Id: I6456dd61aae9853abc1c980d405154afa1b1d0a3

src/mapzen_plugin.c

index 9a95186..9edd7b0 100644 (file)
@@ -185,7 +185,6 @@ EXPORT_API int maps_plugin_is_service_supported(maps_service_e service, bool *su
        case MAPS_SERVICE_SEARCH_PLACE_LIST:
        case MAPS_SERVICE_SEARCH_PLACE_BY_AREA:
        case MAPS_SERVICE_SEARCH_PLACE_BY_ADDRESS:
-       case MAPS_SERVICE_SEARCH_GET_PLACE_DETAILS:
        case MAPS_SERVICE_SEARCH_ROUTE:
        case MAPS_SERVICE_SEARCH_ROUTE_WAYPOINTS:
        case MAPS_SERVICE_CANCEL_REQUEST:
@@ -1225,103 +1224,103 @@ static void __mapzen_place_search_cb(mapzen_error_e result, int request_id, GLis
        }
 }
 
-static void __mapzen_place_get_details_cb(mapzen_error_e result, int request_id, GList *places, void *user_data)
-{
-       MAPS_LOGD("Got places details result from ENGINE...");
-
-       callback_info_place_details *calldata_place = (callback_info_place_details *) user_data;
-
-       if (result != MAPZEN_ERROR_NONE || places == NULL) {
-               MAPS_LOGD("Got places result from ENGINE...result is NULL");
-               calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, NULL, calldata_place->data);
-       } else {
-               guint total_count = 0;
-               total_count = g_list_length(places);
-               /* Should only have one result */
-               if (total_count == 1) {
-                       maps_place_h place = NULL;
-                       MAPS_LOGD("Got places details result from ENGINE... count -> %d", total_count);
-
-                       GList *temp_place = NULL;
-                       temp_place = g_list_first(places);
-
-                       if (temp_place) {
-                               maps_place_create(&place);
-                               mapzen_place_resp_s *mapzen_place = (mapzen_place_resp_s *) temp_place->data;
-                               maps_place_set_id(place, mapzen_place->place_id);
-                               maps_place_set_name(place, mapzen_place->display_name);
-
-                               /* Address */
-                               if (mapzen_place->address) {
-                                       maps_address_h addr = NULL;
-                                       maps_address_create(&addr);
-
-                                       maps_address_set_street(addr, mapzen_place->address->street);
-                                       maps_address_set_building_number(addr, mapzen_place->address->housenumber);
-                                       maps_address_set_city(addr, mapzen_place->address->localadmin);
-                                       maps_address_set_county(addr, mapzen_place->address->county);
-                                       maps_address_set_state(addr, mapzen_place->address->region);
-                                       maps_address_set_country(addr, mapzen_place->address->country);
-                                       maps_address_set_country_code(addr, mapzen_place->address->country_a);
-                                       maps_address_set_postal_code(addr, mapzen_place->address->postalcode);
-                                       maps_address_set_freetext(addr, mapzen_place->display_name);
-
-                                       maps_place_set_address(place, addr);
-                                       maps_address_destroy(addr);
-                               } else {
-                                       maps_place_set_address(place, NULL);
-                               }
-
-                               maps_coordinates_h coord;
-                               maps_coordinates_create(mapzen_place->coordinates.latitude, mapzen_place->coordinates.longitude, &coord);
-
-                               maps_place_set_location(place, coord);
-                               maps_coordinates_destroy(coord);
-
-                               GList *cats = NULL;
-                               cats = g_list_first(mapzen_place->categories);
-
-                               maps_item_list_h cat_list;
-                               maps_item_list_create(&cat_list);
-
-                               while (cats != NULL) {
-                                       if (cats->data != NULL) {
-                                               maps_place_category_h place_cat;
-                                               maps_place_category_create(&place_cat);
-                                               maps_place_category_set_name(place_cat, cats->data);
-                                               maps_item_list_append(cat_list, (void *) place_cat, maps_place_category_clone);
-                                               maps_place_category_destroy(place_cat);
-                                       }
-                                       cats = g_list_next(cats);
-                               }
-
-                               if (g_list_length(cat_list) > 0) {
-                                       maps_place_set_categories(place, cat_list);
-                                       maps_item_list_remove_all(cat_list, maps_place_category_destroy);
-                               }
-                               maps_item_list_destroy(cat_list);
-
-                               /* Don't have URLs yet.... */
-                               /*maps_place_image_h place_image = NULL; */
-                               /*maps_place_image_create(&place_image); */
-                               /*no url at this time. */
-                               /*maps_place_image_set_url(place_image, mapzen_place->icon_url); */
-                               /*maps_item_list_h image_list; */
-                               /*maps_item_list_create(&image_list); */
-                               /*maps_item_list_append(image_list, (void *) place_image, maps_place_image_clone); */
-                               /*maps_place_set_images(place, image_list); */
-
-                               /*maps_place_image_destroy(place_image); */
-                               /*maps_item_list_remove_all(image_list, maps_place_image_destroy); */
-                               /*maps_item_list_destroy(image_list); */
-
-                               calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, place, calldata_place->data);
-                               return;
-                       }
-               }
-       }
-       calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, NULL, calldata_place->data);
-}
+/*static void __mapzen_place_get_details_cb(mapzen_error_e result, int request_id, GList *places, void *user_data)*/
+/*{*/
+       /*MAPS_LOGD("Got places details result from ENGINE...");*/
+
+       /*callback_info_place_details *calldata_place = (callback_info_place_details *) user_data;*/
+
+       /*if (result != MAPZEN_ERROR_NONE || places == NULL) {*/
+               /*MAPS_LOGD("Got places result from ENGINE...result is NULL");*/
+               /*calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, NULL, calldata_place->data);*/
+       /*} else {*/
+               /*guint total_count = 0;*/
+               /*total_count = g_list_length(places);*/
+               /*[> Should only have one result <]*/
+               /*if (total_count == 1) {*/
+                       /*maps_place_h place = NULL;*/
+                       /*MAPS_LOGD("Got places details result from ENGINE... count -> %d", total_count);*/
+
+                       /*GList *temp_place = NULL;*/
+                       /*temp_place = g_list_first(places);*/
+
+                       /*if (temp_place) {*/
+                               /*maps_place_create(&place);*/
+                               /*mapzen_place_resp_s *mapzen_place = (mapzen_place_resp_s *) temp_place->data;*/
+                               /*maps_place_set_id(place, mapzen_place->place_id);*/
+                               /*maps_place_set_name(place, mapzen_place->display_name);*/
+
+                               /*[> Address <]*/
+                               /*if (mapzen_place->address) {*/
+                                       /*maps_address_h addr = NULL;*/
+                                       /*maps_address_create(&addr);*/
+
+                                       /*maps_address_set_street(addr, mapzen_place->address->street);*/
+                                       /*maps_address_set_building_number(addr, mapzen_place->address->housenumber);*/
+                                       /*maps_address_set_city(addr, mapzen_place->address->localadmin);*/
+                                       /*maps_address_set_county(addr, mapzen_place->address->county);*/
+                                       /*maps_address_set_state(addr, mapzen_place->address->region);*/
+                                       /*maps_address_set_country(addr, mapzen_place->address->country);*/
+                                       /*maps_address_set_country_code(addr, mapzen_place->address->country_a);*/
+                                       /*maps_address_set_postal_code(addr, mapzen_place->address->postalcode);*/
+                                       /*maps_address_set_freetext(addr, mapzen_place->display_name);*/
+
+                                       /*maps_place_set_address(place, addr);*/
+                                       /*maps_address_destroy(addr);*/
+                               /*} else {*/
+                                       /*maps_place_set_address(place, NULL);*/
+                               /*}*/
+
+                               /*maps_coordinates_h coord;*/
+                               /*maps_coordinates_create(mapzen_place->coordinates.latitude, mapzen_place->coordinates.longitude, &coord);*/
+
+                               /*maps_place_set_location(place, coord);*/
+                               /*maps_coordinates_destroy(coord);*/
+
+                               /*GList *cats = NULL;*/
+                               /*cats = g_list_first(mapzen_place->categories);*/
+
+                               /*maps_item_list_h cat_list;*/
+                               /*maps_item_list_create(&cat_list);*/
+
+                               /*while (cats != NULL) {*/
+                                       /*if (cats->data != NULL) {*/
+                                               /*maps_place_category_h place_cat;*/
+                                               /*maps_place_category_create(&place_cat);*/
+                                               /*maps_place_category_set_name(place_cat, cats->data);*/
+                                               /*maps_item_list_append(cat_list, (void *) place_cat, maps_place_category_clone);*/
+                                               /*maps_place_category_destroy(place_cat);*/
+                                       /*}*/
+                                       /*cats = g_list_next(cats);*/
+                               /*}*/
+
+                               /*if (g_list_length(cat_list) > 0) {*/
+                                       /*maps_place_set_categories(place, cat_list);*/
+                                       /*maps_item_list_remove_all(cat_list, maps_place_category_destroy);*/
+                               /*}*/
+                               /*maps_item_list_destroy(cat_list);*/
+
+                               /*[> Don't have URLs yet.... <]*/
+                               /*[>maps_place_image_h place_image = NULL; <]*/
+                               /*[>maps_place_image_create(&place_image); <]*/
+                               /*[>no url at this time. <]*/
+                               /*[>maps_place_image_set_url(place_image, mapzen_place->icon_url); <]*/
+                               /*[>maps_item_list_h image_list; <]*/
+                               /*[>maps_item_list_create(&image_list); <]*/
+                               /*[>maps_item_list_append(image_list, (void *) place_image, maps_place_image_clone); <]*/
+                               /*[>maps_place_set_images(place, image_list); <]*/
+
+                               /*[>maps_place_image_destroy(place_image); <]*/
+                               /*[>maps_item_list_remove_all(image_list, maps_place_image_destroy); <]*/
+                               /*[>maps_item_list_destroy(image_list); <]*/
+
+                               /*calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, place, calldata_place->data);*/
+                               /*return;*/
+                       /*}*/
+               /*}*/
+       /*}*/
+       /*calldata_place->callback((maps_error_e)convert_mapzen_error_to_maps_error(result), calldata_place->reqID, NULL, calldata_place->data);*/
+/*}*/
 
 static void __maps_service_search_place_list_cb(mapzen_error_e result, int request_id, GList *places, void *user_data)
 {
@@ -1713,7 +1712,10 @@ EXPORT_API int maps_plugin_search_place_list(const maps_area_h boundary, const m
 
 EXPORT_API int maps_plugin_get_place_details(const char *uri, maps_service_get_place_details_cb callback, void *user_data, int *request_id)
 {
-       if (!uri || !callback || !request_id)
+       return  MAPS_ERROR_NOT_SUPPORTED;
+
+    /* Following is not currently supported by mapzen plugin */
+       /*if (!uri || !callback || !request_id)
                return MAPS_ERROR_INVALID_PARAMETER;
 
        callback_info_place_details *calldata_place = (callback_info_place_details *)g_malloc0(sizeof(callback_info_place_details));
@@ -1738,7 +1740,7 @@ EXPORT_API int maps_plugin_get_place_details(const char *uri, maps_service_get_p
 
        int ret = mapzen_get_place_details(place_req, __mapzen_place_get_details_cb, __request_id, (void *) calldata_place);
 
-       return convert_mapzen_error_to_maps_error(ret);
+       return convert_mapzen_error_to_maps_error(ret); */
 }
 
 EXPORT_API int maps_plugin_search_place_by_address(const char *address, const maps_area_h boundary, const maps_place_filter_h filter, const maps_preference_h preference, maps_service_search_place_cb callback, void *user_data, int *request_id)