/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
#include <stdio.h>
#include <stdlib.h>
EXPORT_API int maps_plugin_multi_reverse_geocode(const maps_coordinates_list_h geocode_list,
const maps_preference_h preference, maps_service_multi_reverse_geocode_cb callback,
- void *user_data, int *request_id){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView){return MAPS_ERROR_NOT_SUPPORTED ;}
+ void *user_data, int *request_id) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_create_map_view(maps_view_h hView, maps_plugin_map_view_ready_cb pCbFunc) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_destroy_map_view(maps_view_h hView) { return MAPS_ERROR_NOT_SUPPORTED; }
EXPORT_API int maps_plugin_render_map(maps_view_h hView,
- const maps_coordinates_h coordinates, double zoom_factor, double rotation_angle){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_move_center(maps_view_h hView, int delta_x, int delta_y){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas* canvas, int x, int y, int w, int h){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_screen_to_geography(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int* x, int* y){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level){return MAPS_ERROR_NOT_SUPPORTED ;}
-EXPORT_API int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center){return MAPS_ERROR_NOT_SUPPORTED ;}
+ const maps_coordinates_h coordinates, double zoom_factor, double rotation_angle) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_move_center(maps_view_h hView, int delta_x, int delta_y) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_set_scalebar(maps_view_h hView, bool enable) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_get_scalebar(maps_view_h hView, bool *enabled) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_draw_map(maps_view_h hView, Evas *canvas, int x, int y, int w, int h) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_on_object(maps_view_h hView, const maps_view_object_h object, maps_view_object_operation_e operation) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_screen_to_geography(maps_view_h hView, int x, int y, maps_coordinates_h *mapsCoord) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_geography_to_screen(maps_view_h hView, const maps_coordinates_h mapsCoord, int *x, int *y) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_get_min_zoom_level(maps_view_h hView, int *min_zoom_level) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_get_max_zoom_level(maps_view_h hView, int *max_zoom_level) { return MAPS_ERROR_NOT_SUPPORTED; }
+EXPORT_API int maps_plugin_get_center(maps_view_h hView, maps_coordinates_h *center) { return MAPS_ERROR_NOT_SUPPORTED; }
/*END MASSIVE TODO:
*/
return MAPS_ERROR_INVALID_PARAMETER;
int ret = MAPS_ERROR_NONE;
- if (!__plugin) {
+ if (!__plugin)
ret = mapzen_init();
- }
if (ret == MAPS_ERROR_NONE) {
__maps_service_instance_count++;
maps_address_h addr = NULL;
maps_address_create(&addr);
- //TODO: housenumber??
+ /*TODO: housenumber?? */
maps_address_set_street(addr, address->street);
maps_address_set_city(addr, address->localadmin);
maps_address_set_county(addr, address->county);
maps_route_maneuver_create(&man);
mapzen_route_maneuver *maneuver = (mapzen_route_maneuver *) maneuver_data->data;
- // Segment Origin and Destination
+ /* Segment Origin and Destination */
maps_coordinates_h segmentStartPoint;
maps_coordinates_create(maneuver->start_point.latitude, maneuver->start_point.longitude, &segmentStartPoint);
- maps_route_segment_set_origin(segment, segmentStartPoint); // origin
+ maps_route_segment_set_origin(segment, segmentStartPoint); /* origin */
maps_coordinates_destroy(segmentStartPoint);
maps_coordinates_h segmentEndPoint;
MAPS_LOGD(">>> Segment start : %f, %f <<<", maneuver->start_point.latitude, maneuver->start_point.longitude);
MAPS_LOGD(">>> Segment end : %f, %f <<<", maneuver->end_point.latitude, maneuver->end_point.longitude);
- maps_route_segment_set_destination(segment, segmentEndPoint); // destination
+ maps_route_segment_set_destination(segment, segmentEndPoint); /* destination */
maps_coordinates_destroy(segmentEndPoint);
- // Segment distance
+ /* Segment distance */
maps_route_segment_set_distance(segment, maneuver->distance);
maps_route_segment_set_duration(segment, maneuver->time);
- // Maneuver distance
+ /* Maneuver distance */
maps_route_maneuver_set_distance_to_next_instruction(man, maneuver->distance);
maps_route_maneuver_set_time_to_next_instruction(man, maneuver->time);
- //maps_route_maneuver_set_turn_type(man, __convert_route_turn_type(maneuver->turn_type));
+ /*maps_route_maneuver_set_turn_type(man, __convert_route_turn_type(maneuver->turn_type)); */
- // maneuver_set_traffic_direction(man, (traffic_direction_e)action_id);
+ /* maneuver_set_traffic_direction(man, (traffic_direction_e)action_id); */
- // Maneuver Instruction
+ /* Maneuver Instruction */
if (maneuver->instruction)
maps_route_maneuver_set_instruction_text(man, (char *) maneuver->instruction);
- // Maneuver Street Name
+ /* Maneuver Street Name */
if (maneuver->street_name) {
MAPS_LOGD("Street Name >>>> %s", maneuver->street_name);
maps_route_maneuver_set_road_name(man, (char *) maneuver->street_name);
MAPS_LOGD("Street Name >>>> NIL");
}
- /// Maneuver start position
+ /*/ Maneuver start position */
maps_coordinates_h coord;
maps_coordinates_create(maneuver->start_point.latitude, maneuver->start_point.longitude, &coord);
maps_item_list_append(segment_list, (gpointer) segment, maps_route_segment_clone);
maps_route_segment_destroy(segment);
- // Fetching the next item from Maneuver/Segment list
+ /* Fetching the next item from Maneuver/Segment list */
maneuver_data = g_list_next(maneuver_data);
}
maps_route_set_segments(route, segment_list);
maps_item_list_destroy(segment_list);
- // Shape points - path
+ /* Shape points - path */
maps_item_list_h path_list = NULL;
maps_item_list_create(&path_list);
else if (transport_mode == MAPS_ROUTE_TRANSPORT_MODE_PUBLICTRANSIT)
route_req->type = COSTING_MULTIMODAL;
else
- route_req->type = COSTING_AUTO; // Keeping it as default
+ route_req->type = COSTING_AUTO; /* Keeping it as default */
- route_req->driving_style = DRIVING_STYLE_NORMAL; // Keeping it as default
+ route_req->driving_style = DRIVING_STYLE_NORMAL; /* Keeping it as default */
- // Unit
+ /* Unit */
maps_distance_unit_e unit;
maps_preference_get_distance_unit(preference, &unit);
switch (unit) {
case MAPS_DISTANCE_UNIT_M:
- route_req->unit = UNIT_M; //miles, not meters
+ route_req->unit = UNIT_M; /*miles, not meters */
break;
case MAPS_DISTANCE_UNIT_KM:
route_req->unit = UNIT_KM;
break;
case MAPS_DISTANCE_UNIT_FT:
- //route_req->unit = ROUTE_UNIT_FT;
+ /*route_req->unit = ROUTE_UNIT_FT; */
break;
case MAPS_DISTANCE_UNIT_YD:
- //route_req->unit = ROUTE_UNIT_YD;
+ /*route_req->unit = ROUTE_UNIT_YD; */
break;
}
else if (transport_mode == MAPS_ROUTE_TRANSPORT_MODE_PUBLICTRANSIT)
route_req->type = COSTING_MULTIMODAL;
else
- route_req->type = COSTING_AUTO; // Keeping it as default
+ route_req->type = COSTING_AUTO; /* Keeping it as default */
- route_req->driving_style = DRIVING_STYLE_NORMAL; // Keeping it as default
+ route_req->driving_style = DRIVING_STYLE_NORMAL; /* Keeping it as default */
- // Unit
+ /* Unit */
maps_distance_unit_e unit;
maps_preference_get_distance_unit(preference, &unit);
switch (unit) {
case MAPS_DISTANCE_UNIT_M:
- route_req->unit = UNIT_M; //miles, not meters
+ route_req->unit = UNIT_M; /*miles, not meters */
break;
case MAPS_DISTANCE_UNIT_KM:
route_req->unit = UNIT_KM;
break;
case MAPS_DISTANCE_UNIT_FT:
- // route_req->unit = ROUTE_UNIT_FT;
+ /* route_req->unit = ROUTE_UNIT_FT; */
break;
case MAPS_DISTANCE_UNIT_YD:
- // route_req->unit = ROUTE_UNIT_YD;
+ /* route_req->unit = ROUTE_UNIT_YD; */
break;
}
route_req->avoids = PENALTY_NONE;
}
- // Waypoints
+ /* Waypoints */
route_req->way_points = NULL;
if (waypoint_num != 0) {
int index = 0;
}
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);
+ /* 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);
+ /*maps_place_image_destroy(place_image); */
+ /*maps_item_list_remove_all(image_list, maps_place_image_destroy); */
+ /*maps_item_list_destroy(image_list); */
bool b = calldata_place->callback((maps_error_e)__convert_to_maps_error(result), calldata_place->reqID, index, total_count, place, calldata_place->data);
if (!b)
} else {
guint total_count = 0;
total_count = g_list_length(places);
- // Should only have one result
+ /* 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);
}
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);
+ /* 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);
+ /*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_to_maps_error(result), calldata_place->reqID, place, calldata_place->data);
return;
}
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);
+ /* 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);
+ /*maps_place_image_destroy(place_image); */
+ /*maps_item_list_remove_all(image_list, maps_place_image_destroy); */
+ /*maps_item_list_destroy(image_list); */
maps_item_list_append(place_list, place, maps_place_clone);
maps_place_image_destroy(place);
return __convert_to_maps_error(ret);
}
-EXPORT_API int maps_plugin_get_place_details(const char* uri, maps_service_get_place_details_cb callback, void* user_data, int* request_id)
+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_INVALID_PARAMETER;