*/
#include <glib.h>
-#include <unistd.h>
+#include <unistd.h> /* to check for Tizen 3.x privilege */
#include <system_info.h>
#include "maps_service.h"
#include "maps_error.h"
static bool __has_maps_service_privilege()
{
+ /* to check for Tizen 3.x privilege */
extern const char *MAPS_PLUGINS_PATH_PREFIX;
return (access(MAPS_PLUGINS_PATH_PREFIX, F_OK) != 0) || /* not exist */
(access(MAPS_PLUGINS_PATH_PREFIX, R_OK) == 0); /* readable */
void *user_data,
int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!address || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
maps_service_geocode_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!address || !bounds || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
maps_service_geocode_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!address || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
callback, void * user_data,
int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (longitude <= -180 || longitude >= 180)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
maps_service_search_place_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!position || (distance < 0) || !filter || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
void *user_data,
int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!boundary || !filter || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
void *user_data,
int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!address || !boundary || !filter || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
maps_service_search_place_list_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!boundary || !filter || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
const char *url, maps_service_get_place_details_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!url || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
maps_service_search_route_cb callback,
void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!origin || !destination || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
void *user_data,
int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if the handle of the Maps Service is valid */
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!waypoint_list || (waypoint_num < 2) || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
/* Check if privileges enough */
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
const maps_coordinates_list_h coordinates_list, const maps_preference_h preference,
maps_service_multi_reverse_geocode_cb callback, void *user_data, int *request_id)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
if (!maps)
return MAPS_ERROR_INVALID_PARAMETER;
if (!coordinates_list || !callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
if (!__has_maps_service_privilege())
return MAPS_ERROR_PERMISSION_DENIED;
EXPORT_API int maps_view_set_center(maps_view_h view, maps_coordinates_h coordinates)
{
- if (!view || !coordinates)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view || !coordinates)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
return __maps_view_set_center(view, coordinates, FALSE);
}
EXPORT_API int maps_view_set_scalebar_enabled(const maps_view_h view, bool enable)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
return __get_plugin_interface(view)->maps_plugin_set_scalebar(view, enable);
}
EXPORT_API int maps_view_set_zoom_level(maps_view_h view, int level)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
int new_level = level;
if (new_level < v->min_zoom_level) new_level = v->min_zoom_level;
EXPORT_API int maps_view_set_orientation(maps_view_h view, double angle)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
/* Add inertia to the rotation process */
maps_view_s *v = (maps_view_s *)view;
if (v->inertial_camera)
EXPORT_API int maps_view_set_type(maps_view_h view, maps_view_type_e type)
{
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
if (!view)
return MAPS_ERROR_INVALID_PARAMETER;
if ((type < MAPS_VIEW_TYPE_NORMAL) || (type > MAPS_VIEW_TYPE_HYBRID))
return MAPS_ERROR_INVALID_PARAMETER;
- /* Check if internet feature is supported */
- if (!_is_internet_feature_supported())
- return MAPS_ERROR_NOT_SUPPORTED;
-
maps_view_s *v = (maps_view_s *) view;
v->type = type;
return maps_view_set_center(view, v->center);
EXPORT_API int maps_view_set_buildings_enabled(maps_view_h view, bool enabled)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
v->buildings_enabled = enabled;
return maps_view_set_center(view, v->center);
EXPORT_API int maps_view_set_traffic_enabled(maps_view_h view, bool enabled)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
v->traffic_enabled = enabled;
return maps_view_set_center(view, v->center);
EXPORT_API int maps_view_set_public_transit_enabled(maps_view_h view, bool enabled)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
v->public_transit_enabled = enabled;
return maps_view_set_center(view, v->center);
EXPORT_API int maps_view_set_language(maps_view_h view, const char *language)
{
- if (!view || !language)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view || !language)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
/* Check if language is supported */
static const char *lngs[] = {
"ara",
EXPORT_API int maps_view_set_screen_location(maps_view_h view, int x, int y, int width, int height)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
int error = maps_view_move(view, x, y);
if (error == MAPS_ERROR_NONE)
error = maps_view_resize(view, width, height);
EXPORT_API int maps_view_move(maps_view_h view, int x, int y)
{
- if (!view)
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
evas_object_move(v->panel, x, y);
evas_object_move(v->clipper, x, y);
EXPORT_API int maps_view_resize(maps_view_h view, int width, int height)
{
- if (!view || (width <= 0) || (height <= 0))
- return MAPS_ERROR_INVALID_PARAMETER;
-
/* Check if internet feature is supported */
if (!_is_internet_feature_supported())
return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view || (width <= 0) || (height <= 0))
+ return MAPS_ERROR_INVALID_PARAMETER;
+
maps_view_s *v = (maps_view_s *) view;
evas_object_resize(v->panel, width, height);
evas_object_resize(v->clipper, width, height);