+[Version] capi-maps-service_0.6.10
+[Date] 10 Feb 2017
+[Title] add APIs to set and get scale of the whole map
+[Developer] Seechan Kim <cbible.kim@samsung.com>
+
[Version] capi-maps-service_0.6.9
[Date] 24 Nov 2016
[Title] added an api for plugins to get length of maps_item_list_h
*/
int maps_view_set_maps_plugin_view_handle(maps_view_h view, void *maps_plugin_view_handle);
+/**
+ * @brief Gets the scale factor of View.
+ * @details This function gets the current scale factor of View.
+ * @since_tizen 4.0
+ *
+ * @param[in] view The view handle
+ * @param[out] scale The pointer to a double in which to store the
+ * current scale factor
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre @a view is created using maps_view_create().
+ *
+ * @see maps_view_set_scale_factor()
+ * @see maps_view_create()
+ */
+int maps_view_get_scale_factor(maps_view_h view, double *scale_factor);
+
+/**
+ * @brief Sets the scale factor of View.
+ * @details This function sets the current scale factor of View.
+ * @remarks View is resizable based on this scale factor.
+ * @since_tizen 4.0
+ *
+ * @param[in] view The view handle
+ * @param[in] scale The new scale factor [0.1 ~ 10.0]
+ * @return 0 on success, otherwise a negative error value
+ * @retval #MAPS_ERROR_NONE Successful
+ * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MAPS_ERROR_NOT_SUPPORTED Not supported
+ *
+ * @pre @a view is created using maps_view_create().
+ *
+ * @see maps_view_get_scale_factor()
+ * @see maps_view_create()
+ */
+int maps_view_set_scale_factor(maps_view_h view, double scale_factor);
+
#ifdef __cplusplus
}
#endif
Name: capi-maps-service
Summary: Tizen Maps Service API
-Version: 0.6.9
+Version: 0.6.10
Release: 1
Group: Location/API
License: Apache-2.0
return htd.object;
}
-EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h hView, void **maps_plugin_view_handle)
+EXPORT_API int maps_view_get_maps_plugin_view_handle(maps_view_h view, void **maps_plugin_view_handle)
{
if (!maps_condition_check_maps_feature())
return MAPS_ERROR_NOT_SUPPORTED;
- if (!hView || !maps_plugin_view_handle)
+ if (!view || !maps_plugin_view_handle)
return MAPS_ERROR_INVALID_PARAMETER;
- maps_view_s *v = (maps_view_s *)hView;
+ maps_view_s *v = (maps_view_s *)view;
*maps_plugin_view_handle = v->maps_plugin_view_handle;
return MAPS_ERROR_NONE;
}
-EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h hView, void *maps_plugin_view_handle)
+EXPORT_API int maps_view_set_maps_plugin_view_handle(maps_view_h view, void *maps_plugin_view_handle)
{
if (!maps_condition_check_maps_feature())
return MAPS_ERROR_NOT_SUPPORTED;
- if (!hView)
+ if (!view)
return MAPS_ERROR_INVALID_PARAMETER;
- maps_view_s *v = (maps_view_s *)hView;
+ maps_view_s *v = (maps_view_s *)view;
v->maps_plugin_view_handle = maps_plugin_view_handle;
return MAPS_ERROR_NONE;
}
+
+EXPORT_API int maps_view_get_scale_factor(maps_view_h view, double *scale_factor)
+{
+ if (!maps_condition_check_maps_feature())
+ return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view || !scale_factor)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ const plugin::interface_s *plugin = __get_plugin_interface(view);
+ if (!plugin)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ if (!plugin->maps_plugin_get_view_scale_factor)
+ return MAPS_ERROR_NOT_SUPPORTED;
+ return plugin->maps_plugin_get_view_scale_factor(view, scale_factor);
+}
+
+EXPORT_API int maps_view_set_scale_factor(maps_view_h view, double scale_factor)
+{
+ if (!maps_condition_check_maps_feature())
+ return MAPS_ERROR_NOT_SUPPORTED;
+ if (!view)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ if (scale_factor < 0.1 || scale_factor > 10.0)
+ return MAPS_ERROR_INVALID_PARAMETER;
+
+ const plugin::interface_s *plugin = __get_plugin_interface(view);
+ if (!plugin)
+ return MAPS_ERROR_INVALID_PARAMETER;
+ if (!plugin->maps_plugin_set_view_scale_factor)
+ return MAPS_ERROR_NOT_SUPPORTED;
+
+ return plugin->maps_plugin_set_view_scale_factor(view, scale_factor);
+}
+
return 0;
}
+int maps_plugin_get_view_scale_factor_empty(maps_view_h view, double *scale_factor)
+{
+ return 0;
+}
+
+int maps_plugin_set_view_scale_factor_empty(maps_view_h view, double scale_factor)
+{
+ return 0;
+}
+
+
/* Interface of a plugin with all empty functions */
plugin::interface_s empty_interface = {
/* Plugin dedicated functions */
maps_plugin_get_max_zoom_level_empty,
maps_plugin_get_center_empty,
maps_plugin_capture_snapshot_empty,
+ maps_plugin_get_view_scale_factor_empty,
+ maps_plugin_set_view_scale_factor_empty,
};
new_plugin->interface.maps_plugin_capture_snapshot =
(maps_plugin_capture_snapshot_f) gmod_find_sym(plugin,
"maps_plugin_capture_snapshot");
+ new_plugin->interface.maps_plugin_get_view_scale_factor =
+ (maps_plugin_get_view_scale_factor_f) gmod_find_sym(plugin,
+ "maps_plugin_get_view_scale_factor");
+ new_plugin->interface.maps_plugin_set_view_scale_factor =
+ (maps_plugin_set_view_scale_factor_f) gmod_find_sym(plugin,
+ "maps_plugin_set_view_scale_factor");
/* 2.3 Check whether the plugin init function is valid */
if (!new_plugin->interface.maps_plugin_init) {
typedef int (*maps_plugin_get_center_f) (maps_view_h view, maps_coordinates_h *coordinates);
typedef int (*maps_plugin_capture_snapshot_f) (maps_view_h view, void **data,
int *width, int *height, maps_view_colorspace_type_e *cs);
+typedef int (*maps_plugin_get_view_scale_factor_f) (maps_view_h view, double *scale_factor);
+typedef int (*maps_plugin_set_view_scale_factor_f) (maps_view_h view, double scale_factor);
namespace plugin {
maps_plugin_get_max_zoom_level_f maps_plugin_get_max_zoom_level;
maps_plugin_get_center_f maps_plugin_get_center;
maps_plugin_capture_snapshot_f maps_plugin_capture_snapshot;
+ maps_plugin_get_view_scale_factor_f maps_plugin_get_view_scale_factor;
+ maps_plugin_set_view_scale_factor_f maps_plugin_set_view_scale_factor;
} interface_s;
/* Plugin structure */