#include <glib.h>
#include <unistd.h>
+#include <system_info.h>
#include "maps_service.h"
#include "maps_error.h"
#include "maps_service.h"
return supported;
}
+bool _is_internet_feature_supported(void)
+{
+ static bool __is_checked = false;
+ static bool __is_supported = true;
+
+ if (!__is_checked) {
+ char *profile = NULL;
+ int ret = system_info_get_platform_string("http://tizen.org/feature/profile", &profile);
+ if (ret == SYSTEM_INFO_ERROR_NONE && profile && *profile) {
+ MAPS_LOGD("profile : %s", profile);
+
+ /* if wearable, check internet feature in addition */
+ if (!strcmp("wearable", profile)) {
+ ret = system_info_get_platform_bool("http://tizen.org/feature/network.internet", &__is_supported);
+ MAPS_LOGD("internet feature supported : %d", __is_supported);
+ }
+ g_free(profile);
+
+ /* set the flag which means feature checked */
+ __is_checked = (ret == SYSTEM_INFO_ERROR_NONE);
+ }
+ }
+
+ return __is_supported;
+}
+
static bool __has_maps_service_privilege()
{
extern const char *MAPS_PLUGINS_PATH_PREFIX;
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;
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;
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;
/* Check if parameters are valid */
if (!callback || !request_id)
return MAPS_ERROR_INVALID_PARAMETER;
- if (latitude <= -90 && latitude >= 90)
+ if (latitude <= -90 || latitude >= 90)
return MAPS_ERROR_INVALID_PARAMETER;
- if (longitude <= -180 && longitude >= 180)
+ 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;
return MAPS_ERROR_NOT_SUPPORTED;
/* Check if parameters are valid */
- if (!position || !filter || !callback || !request_id)
+ 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;
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;
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;
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;
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;
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;
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;
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;
/* ---------------------------------------------------------------------------*/
extern plugin::plugin_s *__extract_plugin(maps_service_h maps);
+extern bool _is_internet_feature_supported(void);
extern int _maps_view_event_data_set_type(const maps_view_event_data_h event, maps_view_event_type_e event_type);
extern int _maps_view_event_data_set_gesture_type(const maps_view_event_data_h event, maps_view_gesture_e gesture_type);
extern int _maps_view_event_data_set_action_type(const maps_view_event_data_h event, maps_view_action_e action_type);
v->maps = maps;
/* Set up canvas and Ecore */
- maps_view_set_language(v, "eng");
+ v->language = g_strdup("eng");
/* Add an idle handler */
v->idler = ecore_idler_add(__maps_view_on_idle_cb, v);
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;
+
return __maps_view_set_center(view, coordinates, FALSE);
}
if (!view)
return MAPS_ERROR_INVALID_PARAMETER;
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
return __get_plugin_interface(view)->maps_plugin_set_scalebar(view, enable);
}
if (!view)
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;
int new_level = level;
if (new_level < v->min_zoom_level) new_level = v->min_zoom_level;
if (!view)
return MAPS_ERROR_INVALID_PARAMETER;
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Add inertia to the rotation process */
maps_view_s *v = (maps_view_s *)view;
if (v->inertial_camera)
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);
{
if (!view)
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->buildings_enabled = enabled;
return maps_view_set_center(view, v->center);
{
if (!view)
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->traffic_enabled = enabled;
return maps_view_set_center(view, v->center);
{
if (!view)
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->public_transit_enabled = enabled;
return maps_view_set_center(view, v->center);
if (!view || !language)
return MAPS_ERROR_INVALID_PARAMETER;
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
/* Check if language is supported */
static const char *lngs[] = {
"ara",
{
if (!view)
return MAPS_ERROR_INVALID_PARAMETER;
+
+ /* Check if internet feature is supported */
+ if (!_is_internet_feature_supported())
+ return MAPS_ERROR_NOT_SUPPORTED;
+
int error = maps_view_move(view, x, y);
if (error == MAPS_ERROR_NONE)
error = maps_view_resize(view, width, height);
{
if (!view)
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;
evas_object_move(v->panel, x, y);
evas_object_move(v->clipper, x, y);
{
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;
+
maps_view_s *v = (maps_view_s *) view;
evas_object_resize(v->panel, width, height);
evas_object_resize(v->clipper, width, height);