5 * @image html img/widget/map/preview-00.png
6 * @image latex img/widget/map/preview-00.eps
8 * This is a widget specifically for displaying a map. It uses basically
9 * OpenStreetMap provider http://www.openstreetmap.org/,
10 * but custom providers can be added.
12 * It supports some basic but yet nice features:
14 * @li markers with content to be displayed when user clicks over it
15 * @li group of markers
18 * Smart callbacks one can listen to:
20 * - "clicked" - This is called when a user has clicked the map without
22 * - "press" - This is called when a user has pressed down on the map.
23 * - "longpressed" - This is called when a user has pressed down on the map
24 * for a long time without dragging around.
25 * - "clicked,double" - This is called when a user has double-clicked
27 * - "load,detail" - Map detailed data load begins.
28 * - "loaded,detail" - This is called when all currently visible parts of
30 * - "zoom,start" - Zoom animation started.
31 * - "zoom,stop" - Zoom animation stopped.
32 * - "zoom,change" - Zoom changed when using an auto zoom mode.
33 * - "scroll" - the content has been scrolled (moved).
34 * - "scroll,anim,start" - scrolling animation has started.
35 * - "scroll,anim,stop" - scrolling animation has stopped.
36 * - "scroll,drag,start" - dragging the contents around has started.
37 * - "scroll,drag,stop" - dragging the contents around has stopped.
38 * - "downloaded" - This is called when all currently required map images
40 * - "route,load" - This is called when route request begins.
41 * - "route,loaded" - This is called when route request ends.
42 * - "name,load" - This is called when name request begins.
43 * - "name,loaded- This is called when name request ends.
45 * Available style for map widget:
48 * Available style for markers:
53 * Available style for marker bubble:
57 * @li @ref map_example_01
58 * @li @ref map_example_02
59 * @li @ref map_example_03
68 * @enum _Elm_Map_Zoom_Mode
69 * @typedef Elm_Map_Zoom_Mode
71 * Set map's zoom behavior. It can be set to manual or automatic.
73 * Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
75 * Values <b> don't </b> work as bitmask, only one can be choosen.
77 * @note Valid sizes are 2^zoom, consequently the map may be smaller
78 * than the scroller view.
80 * @see elm_map_zoom_mode_set()
81 * @see elm_map_zoom_mode_get()
85 typedef enum _Elm_Map_Zoom_Mode
87 ELM_MAP_ZOOM_MODE_MANUAL, /**< Zoom controlled manually by elm_map_zoom_set(). It's set by default. */
88 ELM_MAP_ZOOM_MODE_AUTO_FIT, /**< Zoom until map fits inside the scroll frame with no pixels outside this area. */
89 ELM_MAP_ZOOM_MODE_AUTO_FILL, /**< Zoom until map fills scroll, ensuring no pixels are left unfilled. */
90 ELM_MAP_ZOOM_MODE_LAST
94 * @enum _Elm_Map_Route_Sources
95 * @typedef Elm_Map_Route_Sources
97 * Set route service to be used. By default used source is
98 * #ELM_MAP_ROUTE_SOURCE_YOURS.
100 * @see elm_map_route_source_set()
101 * @see elm_map_route_source_get()
105 typedef enum _Elm_Map_Route_Sources
107 ELM_MAP_ROUTE_SOURCE_YOURS, /**< Routing service http://www.yournavigation.org/ . Set by default.*/
108 ELM_MAP_ROUTE_SOURCE_MONAV, /**< MoNav offers exact routing without heuristic assumptions. Its routing core is based on Contraction Hierarchies. It's not working with Map yet. */
109 ELM_MAP_ROUTE_SOURCE_ORS, /**< Open Route Service: http://www.openrouteservice.org/ . It's not working with Map yet. */
110 ELM_MAP_ROUTE_SOURCE_LAST
111 } Elm_Map_Route_Sources;
113 typedef enum _Elm_Map_Name_Sources
115 ELM_MAP_NAME_SOURCE_NOMINATIM,
116 ELM_MAP_NAME_SOURCE_LAST
117 } Elm_Map_Name_Sources;
120 * @enum _Elm_Map_Route_Type
121 * @typedef Elm_Map_Route_Type
123 * Set type of transport used on route.
125 * @see elm_map_route_add()
129 typedef enum _Elm_Map_Route_Type
131 ELM_MAP_ROUTE_TYPE_MOTOCAR, /**< Route should consider an automobile will be used. */
132 ELM_MAP_ROUTE_TYPE_BICYCLE, /**< Route should consider a bicycle will be used by the user. */
133 ELM_MAP_ROUTE_TYPE_FOOT, /**< Route should consider user will be walking. */
134 ELM_MAP_ROUTE_TYPE_LAST
135 } Elm_Map_Route_Type;
138 * @enum _Elm_Map_Route_Method
139 * @typedef Elm_Map_Route_Method
141 * Set the routing method, what should be priorized, time or distance.
143 * @see elm_map_route_add()
147 typedef enum _Elm_Map_Route_Method
149 ELM_MAP_ROUTE_METHOD_FASTEST, /**< Route should priorize time. */
150 ELM_MAP_ROUTE_METHOD_SHORTEST, /**< Route should priorize distance. */
151 ELM_MAP_ROUTE_METHOD_LAST
152 } Elm_Map_Route_Method;
154 typedef enum _Elm_Map_Name_Method
156 ELM_MAP_NAME_METHOD_SEARCH,
157 ELM_MAP_NAME_METHOD_REVERSE,
158 ELM_MAP_NAME_METHOD_LAST
159 } Elm_Map_Name_Method;
161 typedef struct _Elm_Map_Marker Elm_Map_Marker; /**< A marker to be shown in a specific point of the map. Can be created with elm_map_marker_add() and deleted with elm_map_marker_remove(). */
162 typedef struct _Elm_Map_Marker_Class Elm_Map_Marker_Class; /**< Each marker must be associated to a class. It's required to add a mark. The class defines the style of the marker when a marker is displayed alone (not grouped). A new class can be created with elm_map_marker_class_new(). */
163 typedef struct _Elm_Map_Group_Class Elm_Map_Group_Class; /**< Each marker must be associated to a group class. It's required to add a mark. The group class defines the style of the marker when a marker is grouped to other markers. Markers with the same group are grouped if they are close. A new group class can be created with elm_map_marker_group_class_new(). */
164 typedef struct _Elm_Map_Route Elm_Map_Route; /**< A route to be shown in the map. Can be created with elm_map_route_add() and deleted with elm_map_route_remove(). */
165 typedef struct _Elm_Map_Name Elm_Map_Name; /**< A handle for specific coordinates. */
166 typedef struct _Elm_Map_Track Elm_Map_Track;
168 typedef Evas_Object *(*ElmMapMarkerGetFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Bubble content fetching class function for marker classes. When the user click on a marker, a bubble is displayed with a content. */
169 typedef void (*ElmMapMarkerDelFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data, Evas_Object *o); /**< Function to delete bubble content for marker classes. */
170 typedef Evas_Object *(*ElmMapMarkerIconGetFunc)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Icon fetching class function for marker classes. */
171 typedef Evas_Object *(*ElmMapGroupIconGetFunc)(Evas_Object *obj, void *data); /**< Icon fetching class function for markers group classes. */
173 typedef char *(*ElmMapModuleSourceFunc)(void);
174 typedef int (*ElmMapModuleZoomMinFunc)(void);
175 typedef int (*ElmMapModuleZoomMaxFunc)(void);
176 typedef char *(*ElmMapModuleUrlFunc)(Evas_Object *obj, int x, int y, int zoom);
177 typedef int (*ElmMapModuleRouteSourceFunc)(void);
178 typedef char *(*ElmMapModuleRouteUrlFunc)(Evas_Object *obj, char *type_name, int method, double flon, double flat, double tlon, double tlat);
179 typedef char *(*ElmMapModuleNameUrlFunc)(Evas_Object *obj, int method, char *name, double lon, double lat);
180 typedef Eina_Bool (*ElmMapModuleGeoIntoCoordFunc)(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y);
181 typedef Eina_Bool (*ElmMapModuleCoordIntoGeoFunc)(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat);
184 * Add a new map widget to the given parent Elementary (container) object.
186 * @param parent The parent object.
187 * @return a new map widget handle or @c NULL, on errors.
189 * This function inserts a new map widget on the canvas.
194 elm_map_add(Evas_Object *parent)
198 * Set the zoom level of the map.
200 * @param obj The map object.
201 * @param zoom The zoom level to set.
203 * This sets the zoom level.
205 * It will respect limits defined by elm_map_source_zoom_min_set() and
206 * elm_map_source_zoom_max_set().
208 * By default these values are 0 (world map) and 18 (maximum zoom).
210 * This function should be used when zoom mode is set to
211 * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set
212 * with elm_map_zoom_mode_set().
214 * @see elm_map_zoom_mode_set().
215 * @see elm_map_zoom_get().
219 EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
222 * Get the zoom level of the map.
224 * @param obj The map object.
225 * @return The current zoom level.
227 * This returns the current zoom level of the map object.
229 * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
230 * (which is the default), the zoom level may be changed at any time by the
231 * map object itself to account for map size and map viewport size.
233 * @see elm_map_zoom_set() for details.
237 EAPI int elm_map_zoom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
240 * Set the zoom mode used by the map object.
242 * @param obj The map object.
243 * @param mode The zoom mode of the map, being it one of
244 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
245 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
247 * This sets the zoom mode to manual or one of the automatic levels.
248 * Manual (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
249 * elm_map_zoom_set() and will stay at that level until changed by code
250 * or until zoom mode is changed. This is the default mode.
252 * The Automatic modes will allow the map object to automatically
253 * adjust zoom mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will
254 * adjust zoom so the map fits inside the scroll frame with no pixels
255 * outside this area. #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but
256 * ensure no pixels within the frame are left unfilled. Do not forget that
257 * the valid sizes are 2^zoom, consequently the map may be smaller than
260 * @see elm_map_zoom_set()
264 EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode) EINA_ARG_NONNULL(1);
267 * Get the zoom mode used by the map object.
269 * @param obj The map object.
270 * @return The zoom mode of the map, being it one of
271 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
272 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
274 * This function returns the current zoom mode used by the map object.
276 * @see elm_map_zoom_mode_set() for more details.
280 EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
283 * Get the current coordinates of the map.
285 * @param obj The map object.
286 * @param lon Pointer where to store longitude.
287 * @param lat Pointer where to store latitude.
289 * This gets the current center coordinates of the map object. It can be
290 * set by elm_map_geo_region_bring_in() and elm_map_geo_region_show().
292 * @see elm_map_geo_region_bring_in()
293 * @see elm_map_geo_region_show()
297 EAPI void elm_map_geo_region_get(const Evas_Object *obj, double *lon, double *lat) EINA_ARG_NONNULL(1);
300 * Animatedly bring in given coordinates to the center of the map.
302 * @param obj The map object.
303 * @param lon Longitude to center at.
304 * @param lat Latitude to center at.
306 * This causes map to jump to the given @p lat and @p lon coordinates
307 * and show it (by scrolling) in the center of the viewport, if it is not
308 * already centered. This will use animation to do so and take a period
309 * of time to complete.
311 * @see elm_map_geo_region_show() for a function to avoid animation.
312 * @see elm_map_geo_region_get()
316 EAPI void elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
319 * Show the given coordinates at the center of the map, @b immediately.
321 * @param obj The map object.
322 * @param lon Longitude to center at.
323 * @param lat Latitude to center at.
325 * This causes map to @b redraw its viewport's contents to the
326 * region contining the given @p lat and @p lon, that will be moved to the
329 * @see elm_map_geo_region_bring_in() for a function to move with animation.
330 * @see elm_map_geo_region_get()
334 EAPI void elm_map_geo_region_show(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
337 * Pause or unpause the map.
339 * @param obj The map object.
340 * @param paused Use @c EINA_TRUE to pause the map @p obj or @c EINA_FALSE
343 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
346 * The default is off.
348 * This will stop zooming using animation, changing zoom levels will
349 * change instantly. This will stop any existing animations that are running.
351 * @see elm_map_paused_get()
355 EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1);
358 * Get a value whether map is paused or not.
360 * @param obj The map object.
361 * @return @c EINA_TRUE means map is pause. @c EINA_FALSE indicates
362 * it is not. If @p obj is @c NULL, @c EINA_FALSE is returned.
364 * This gets the current paused state for the map object.
366 * @see elm_map_paused_set() for details.
370 EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
373 * Set to show markers during zoom level changes or not.
375 * @param obj The map object.
376 * @param paused Use @c EINA_TRUE to @b not show markers or @c EINA_FALSE
379 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
382 * The default is off.
384 * This will stop zooming using animation, changing zoom levels will
385 * change instantly. This will stop any existing animations that are running.
387 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
390 * The default is off.
392 * Enabling it will force the map to stop displaying the markers during
393 * zoom level changes. Set to on if you have a large number of markers.
395 * @see elm_map_paused_markers_get()
399 EAPI void elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1);
402 * Get a value whether markers will be displayed on zoom level changes or not
404 * @param obj The map object.
405 * @return @c EINA_TRUE means map @b won't display markers or @c EINA_FALSE
406 * indicates it will. If @p obj is @c NULL, @c EINA_FALSE is returned.
408 * This gets the current markers paused state for the map object.
410 * @see elm_map_paused_markers_set() for details.
414 EAPI Eina_Bool elm_map_paused_markers_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
417 * Get the information of downloading status.
419 * @param obj The map object.
420 * @param try_num Pointer where to store number of tiles being downloaded.
421 * @param finish_num Pointer where to store number of tiles successfully
424 * This gets the current downloading status for the map object, the number
425 * of tiles being downloaded and the number of tiles already downloaded.
429 EAPI void elm_map_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num) EINA_ARG_NONNULL(1, 2, 3);
432 * Convert a pixel coordinate (x,y) into a geographic coordinate
433 * (longitude, latitude).
435 * @param obj The map object.
436 * @param x the coordinate.
437 * @param y the coordinate.
438 * @param size the size in pixels of the map.
439 * The map is a square and generally his size is : pow(2.0, zoom)*256.
440 * @param lon Pointer where to store the longitude that correspond to x.
441 * @param lat Pointer where to store the latitude that correspond to y.
443 * @note Origin pixel point is the top left corner of the viewport.
444 * Map zoom and size are taken on account.
446 * @see elm_map_utils_convert_geo_into_coord() if you need the inverse.
450 EAPI void elm_map_utils_convert_coord_into_geo(const Evas_Object *obj, int x, int y, int size, double *lon, double *lat) EINA_ARG_NONNULL(1, 5, 6);
453 * Convert a geographic coordinate (longitude, latitude) into a pixel
456 * @param obj The map object.
457 * @param lon the longitude.
458 * @param lat the latitude.
459 * @param size the size in pixels of the map. The map is a square
460 * and generally his size is : pow(2.0, zoom)*256.
461 * @param x Pointer where to store the horizontal pixel coordinate that
462 * correspond to the longitude.
463 * @param y Pointer where to store the vertical pixel coordinate that
464 * correspond to the latitude.
466 * @note Origin pixel point is the top left corner of the viewport.
467 * Map zoom and size are taken on account.
469 * @see elm_map_utils_convert_coord_into_geo() if you need the inverse.
473 EAPI void elm_map_utils_convert_geo_into_coord(const Evas_Object *obj, double lon, double lat, int size, int *x, int *y) EINA_ARG_NONNULL(1, 5, 6);
476 * Convert a geographic coordinate (longitude, latitude) into a name
479 * @param obj The map object.
480 * @param lon the longitude.
481 * @param lat the latitude.
482 * @return name A #Elm_Map_Name handle for this coordinate.
484 * To get the string for this address, elm_map_name_address_get()
487 * @see elm_map_utils_convert_name_into_coord() if you need the inverse.
491 EAPI Elm_Map_Name *elm_map_utils_convert_coord_into_name(const Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
494 * Convert a name (address) into a geographic coordinate
495 * (longitude, latitude).
497 * @param obj The map object.
498 * @param name The address.
499 * @return name A #Elm_Map_Name handle for this address.
501 * To get the longitude and latitude, elm_map_name_region_get()
504 * @see elm_map_utils_convert_coord_into_name() if you need the inverse.
508 EAPI Elm_Map_Name *elm_map_utils_convert_name_into_coord(const Evas_Object *obj, char *address) EINA_ARG_NONNULL(1, 2);
511 * Convert a pixel coordinate into a rotated pixel coordinate.
513 * @param obj The map object.
514 * @param x horizontal coordinate of the point to rotate.
515 * @param y vertical coordinate of the point to rotate.
516 * @param cx rotation's center horizontal position.
517 * @param cy rotation's center vertical position.
518 * @param degree amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
519 * @param xx Pointer where to store rotated x.
520 * @param yy Pointer where to store rotated y.
524 EAPI void elm_map_utils_rotate_coord(const Evas_Object *obj, const Evas_Coord x, const Evas_Coord y, const Evas_Coord cx, const Evas_Coord cy, const double degree, Evas_Coord *xx, Evas_Coord *yy) EINA_ARG_NONNULL(1);
527 * Add a new marker to the map object.
529 * @param obj The map object.
530 * @param lon The longitude of the marker.
531 * @param lat The latitude of the marker.
532 * @param clas The class, to use when marker @b isn't grouped to others.
533 * @param clas_group The class group, to use when marker is grouped to others
534 * @param data The data passed to the callbacks.
536 * @return The created marker or @c NULL upon failure.
538 * A marker will be created and shown in a specific point of the map, defined
539 * by @p lon and @p lat.
541 * It will be displayed using style defined by @p class when this marker
542 * is displayed alone (not grouped). A new class can be created with
543 * elm_map_marker_class_new().
545 * If the marker is grouped to other markers, it will be displayed with
546 * style defined by @p class_group. Markers with the same group are grouped
547 * if they are close. A new group class can be created with
548 * elm_map_marker_group_class_new().
550 * Markers created with this method can be deleted with
551 * elm_map_marker_remove().
553 * A marker can have associated content to be displayed by a bubble,
554 * when a user click over it, as well as an icon. These objects will
555 * be fetch using class' callback functions.
557 * @see elm_map_marker_class_new()
558 * @see elm_map_marker_group_class_new()
559 * @see elm_map_marker_remove()
563 EAPI Elm_Map_Marker *elm_map_marker_add(Evas_Object *obj, double lon, double lat, Elm_Map_Marker_Class *clas, Elm_Map_Group_Class *clas_group, void *data) EINA_ARG_NONNULL(1, 4, 5);
566 * Set the maximum numbers of markers' content to be displayed in a group.
568 * @param obj The map object.
569 * @param max The maximum numbers of items displayed in a bubble.
571 * A bubble will be displayed when the user clicks over the group,
572 * and will place the content of markers that belong to this group
575 * A group can have a long list of markers, consequently the creation
576 * of the content of the bubble can be very slow.
578 * In order to avoid this, a maximum number of items is displayed
581 * By default this number is 30.
583 * Marker with the same group class are grouped if they are close.
585 * @see elm_map_marker_add()
589 EAPI void elm_map_max_marker_per_group_set(Evas_Object *obj, int max) EINA_ARG_NONNULL(1);
592 * Remove a marker from the map.
594 * @param marker The marker to remove.
596 * @see elm_map_marker_add()
600 EAPI void elm_map_marker_remove(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
603 * Get the current coordinates of the marker.
605 * @param marker marker.
606 * @param lat Pointer where to store the marker's latitude.
607 * @param lon Pointer where to store the marker's longitude.
609 * These values are set when adding markers, with function
610 * elm_map_marker_add().
612 * @see elm_map_marker_add()
616 EAPI void elm_map_marker_region_get(const Elm_Map_Marker *marker, double *lon, double *lat) EINA_ARG_NONNULL(1);
619 * Animatedly bring in given marker to the center of the map.
621 * @param marker The marker to center at.
623 * This causes map to jump to the given @p marker's coordinates
624 * and show it (by scrolling) in the center of the viewport, if it is not
625 * already centered. This will use animation to do so and take a period
626 * of time to complete.
628 * @see elm_map_marker_show() for a function to avoid animation.
629 * @see elm_map_marker_region_get()
633 EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
636 * Show the given marker at the center of the map, @b immediately.
638 * @param marker The marker to center at.
640 * This causes map to @b redraw its viewport's contents to the
641 * region contining the given @p marker's coordinates, that will be
642 * moved to the center of the map.
644 * @see elm_map_marker_bring_in() for a function to move with animation.
645 * @see elm_map_markers_list_show() if more than one marker need to be
647 * @see elm_map_marker_region_get()
651 EAPI void elm_map_marker_show(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
654 * Move and zoom the map to display a list of markers.
656 * @param markers A list of #Elm_Map_Marker handles.
658 * The map will be centered on the center point of the markers in the list.
659 * Then the map will be zoomed in order to fit the markers using the maximum
660 * zoom which allows display of all the markers.
662 * @warning All the markers should belong to the same map object.
664 * @see elm_map_marker_show() to show a single marker.
665 * @see elm_map_marker_bring_in()
669 EAPI void elm_map_markers_list_show(Eina_List *markers) EINA_ARG_NONNULL(1);
672 * Get the Evas object returned by the ElmMapMarkerGetFunc callback
674 * @param marker The marker wich content should be returned.
675 * @return Return the evas object if it exists, else @c NULL.
677 * To set callback function #ElmMapMarkerGetFunc for the marker class,
678 * elm_map_marker_class_get_cb_set() should be used.
680 * This content is what will be inside the bubble that will be displayed
681 * when an user clicks over the marker.
683 * This returns the actual Evas object used to be placed inside
684 * the bubble. This may be @c NULL, as it may
685 * not have been created or may have been deleted, at any time, by
686 * the map. <b>Do not modify this object</b> (move, resize,
687 * show, hide, etc.), as the map is controlling it. This
688 * function is for querying, emitting custom signals or hooking
689 * lower level callbacks for events on that object. Do not delete
690 * this object under any circumstances.
694 EAPI Evas_Object *elm_map_marker_object_get(const Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
699 * @param marker The marker to be updated.
701 * If a content is set to this marker, it will call function to delete it,
702 * #ElmMapMarkerDelFunc, and then will fetch the content again with
703 * #ElmMapMarkerGetFunc.
705 * These functions are set for the marker class with
706 * elm_map_marker_class_get_cb_set() and elm_map_marker_class_del_cb_set().
710 EAPI void elm_map_marker_update(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
713 * Close all the bubbles opened by the user.
715 * @param obj The map object.
717 * A bubble is displayed with a content fetched with #ElmMapMarkerGetFunc
718 * when the user clicks on a marker.
720 * This functions is set for the marker class with
721 * elm_map_marker_class_get_cb_set().
725 EAPI void elm_map_bubbles_close(Evas_Object *obj) EINA_ARG_NONNULL(1);
728 * Create a new group class.
730 * @param obj The map object.
731 * @return Returns the new group class.
733 * Each marker must be associated to a group class. Markers in the same
734 * group are grouped if they are close.
736 * The group class defines the style of the marker when a marker is grouped
737 * to others markers. When it is alone, another class will be used.
739 * A group class will need to be provided when creating a marker with
740 * elm_map_marker_add().
742 * Some properties and functions can be set by class, as:
743 * - style, with elm_map_group_class_style_set()
744 * - data - to be associated to the group class. It can be set using
745 * elm_map_group_class_data_set().
746 * - min zoom to display markers, set with
747 * elm_map_group_class_zoom_displayed_set().
748 * - max zoom to group markers, set using
749 * elm_map_group_class_zoom_grouped_set().
750 * - visibility - set if markers will be visible or not, set with
751 * elm_map_group_class_hide_set().
752 * - #ElmMapGroupIconGetFunc - used to fetch icon for markers group classes.
753 * It can be set using elm_map_group_class_icon_cb_set().
755 * @see elm_map_marker_add()
756 * @see elm_map_group_class_style_set()
757 * @see elm_map_group_class_data_set()
758 * @see elm_map_group_class_zoom_displayed_set()
759 * @see elm_map_group_class_zoom_grouped_set()
760 * @see elm_map_group_class_hide_set()
761 * @see elm_map_group_class_icon_cb_set()
765 EAPI Elm_Map_Group_Class *elm_map_group_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1);
768 * Set the marker's style of a group class.
770 * @param clas The group class.
771 * @param style The style to be used by markers.
773 * Each marker must be associated to a group class, and will use the style
774 * defined by such class when grouped to other markers.
776 * The following styles are provided by default theme:
777 * @li @c radio - blue circle
778 * @li @c radio2 - green circle
781 * @see elm_map_group_class_new() for more details.
782 * @see elm_map_marker_add()
786 EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) EINA_ARG_NONNULL(1);
789 * Set the icon callback function of a group class.
791 * @param clas The group class.
792 * @param icon_get The callback function that will return the icon.
794 * Each marker must be associated to a group class, and it can display a
795 * custom icon. The function @p icon_get must return this icon.
797 * @see elm_map_group_class_new() for more details.
798 * @see elm_map_marker_add()
802 EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get) EINA_ARG_NONNULL(1);
805 * Set the data associated to the group class.
807 * @param clas The group class.
808 * @param data The new user data.
810 * This data will be passed for callback functions, like icon get callback,
811 * that can be set with elm_map_group_class_icon_cb_set().
813 * If a data was previously set, the object will lose the pointer for it,
814 * so if needs to be freed, you must do it yourself.
816 * @see elm_map_group_class_new() for more details.
817 * @see elm_map_group_class_icon_cb_set()
818 * @see elm_map_marker_add()
822 EAPI void elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data) EINA_ARG_NONNULL(1);
825 * Set the minimum zoom from where the markers are displayed.
827 * @param clas The group class.
828 * @param zoom The minimum zoom.
830 * Markers only will be displayed when the map is displayed at @p zoom
833 * @see elm_map_group_class_new() for more details.
834 * @see elm_map_marker_add()
838 EAPI void elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1);
841 * Set the zoom from where the markers are no more grouped.
843 * @param clas The group class.
844 * @param zoom The maximum zoom.
846 * Markers only will be grouped when the map is displayed at
849 * @see elm_map_group_class_new() for more details.
850 * @see elm_map_marker_add()
854 EAPI void elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1);
857 * Set if the markers associated to the group class @p clas are hidden or not.
859 * @param clas The group class.
860 * @param hide Use @c EINA_TRUE to hide markers or @c EINA_FALSE
863 * If @p hide is @c EINA_TRUE the markers will be hidden, but default
868 EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_Bool hide) EINA_ARG_NONNULL(1, 2);
871 * Create a new marker class.
873 * @param obj The map object.
874 * @return Returns the new group class.
876 * Each marker must be associated to a class.
878 * The marker class defines the style of the marker when a marker is
879 * displayed alone, i.e., not grouped to to others markers. When grouped
880 * it will use group class style.
882 * A marker class will need to be provided when creating a marker with
883 * elm_map_marker_add().
885 * Some properties and functions can be set by class, as:
886 * - style, with elm_map_marker_class_style_set()
887 * - #ElmMapMarkerIconGetFunc - used to fetch icon for markers classes.
888 * It can be set using elm_map_marker_class_icon_cb_set().
889 * - #ElmMapMarkerGetFunc - used to fetch bubble content for marker classes.
890 * Set using elm_map_marker_class_get_cb_set().
891 * - #ElmMapMarkerDelFunc - used to delete bubble content for marker classes.
892 * Set using elm_map_marker_class_del_cb_set().
894 * @see elm_map_marker_add()
895 * @see elm_map_marker_class_style_set()
896 * @see elm_map_marker_class_icon_cb_set()
897 * @see elm_map_marker_class_get_cb_set()
898 * @see elm_map_marker_class_del_cb_set()
902 EAPI Elm_Map_Marker_Class *elm_map_marker_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1);
905 * Set the marker's style of a marker class.
907 * @param clas The marker class.
908 * @param style The style to be used by markers.
910 * Each marker must be associated to a marker class, and will use the style
911 * defined by such class when alone, i.e., @b not grouped to other markers.
913 * The following styles are provided by default theme:
918 * @see elm_map_marker_class_new() for more details.
919 * @see elm_map_marker_add()
923 EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) EINA_ARG_NONNULL(1);
926 * Set the icon callback function of a marker class.
928 * @param clas The marker class.
929 * @param icon_get The callback function that will return the icon.
931 * Each marker must be associated to a marker class, and it can display a
932 * custom icon. The function @p icon_get must return this icon.
934 * @see elm_map_marker_class_new() for more details.
935 * @see elm_map_marker_add()
939 EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get) EINA_ARG_NONNULL(1);
942 * Set the bubble content callback function of a marker class.
944 * @param clas The marker class.
945 * @param get The callback function that will return the content.
947 * Each marker must be associated to a marker class, and it can display a
948 * a content on a bubble that opens when the user click over the marker.
949 * The function @p get must return this content object.
951 * If this content will need to be deleted, elm_map_marker_class_del_cb_set()
954 * @see elm_map_marker_class_new() for more details.
955 * @see elm_map_marker_class_del_cb_set()
956 * @see elm_map_marker_add()
960 EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get) EINA_ARG_NONNULL(1);
963 * Set the callback function used to delete bubble content of a marker class.
965 * @param clas The marker class.
966 * @param del The callback function that will delete the content.
968 * Each marker must be associated to a marker class, and it can display a
969 * a content on a bubble that opens when the user click over the marker.
970 * The function to return such content can be set with
971 * elm_map_marker_class_get_cb_set().
973 * If this content must be freed, a callback function need to be
974 * set for that task with this function.
976 * If this callback is defined it will have to delete (or not) the
977 * object inside, but if the callback is not defined the object will be
978 * destroyed with evas_object_del().
980 * @see elm_map_marker_class_new() for more details.
981 * @see elm_map_marker_class_get_cb_set()
982 * @see elm_map_marker_add()
986 EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del) EINA_ARG_NONNULL(1);
989 * Get the list of available sources.
991 * @param obj The map object.
992 * @return The source names list.
994 * It will provide a list with all available sources, that can be set as
995 * current source with elm_map_source_name_set(), or get with
996 * elm_map_source_name_get().
1004 * @see elm_map_source_name_set() for more details.
1005 * @see elm_map_source_name_get()
1009 EAPI const char **elm_map_source_names_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1012 * Set the source of the map.
1014 * @param obj The map object.
1015 * @param source The source to be used.
1017 * Map widget retrieves images that composes the map from a web service.
1018 * This web service can be set with this method.
1020 * A different service can return a different maps with different
1021 * information and it can use different zoom values.
1023 * The @p source_name need to match one of the names provided by
1024 * elm_map_source_names_get().
1026 * The current source can be get using elm_map_source_name_get().
1028 * @see elm_map_source_names_get()
1029 * @see elm_map_source_name_get()
1034 EAPI void elm_map_source_name_set(Evas_Object *obj, const char *source_name) EINA_ARG_NONNULL(1);
1037 * Get the name of currently used source.
1039 * @param obj The map object.
1040 * @return Returns the name of the source in use.
1042 * @see elm_map_source_name_set() for more details.
1046 EAPI const char *elm_map_source_name_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1049 * Set the source of the route service to be used by the map.
1051 * @param obj The map object.
1052 * @param source The route service to be used, being it one of
1053 * #ELM_MAP_ROUTE_SOURCE_YOURS (default), #ELM_MAP_ROUTE_SOURCE_MONAV,
1054 * and #ELM_MAP_ROUTE_SOURCE_ORS.
1056 * Each one has its own algorithm, so the route retrieved may
1057 * differ depending on the source route. Now, only the default is working.
1059 * #ELM_MAP_ROUTE_SOURCE_YOURS is the routing service provided at
1060 * http://www.yournavigation.org/.
1062 * #ELM_MAP_ROUTE_SOURCE_MONAV, offers exact routing without heuristic
1063 * assumptions. Its routing core is based on Contraction Hierarchies.
1065 * #ELM_MAP_ROUTE_SOURCE_ORS, is provided at http://www.openrouteservice.org/
1067 * @see elm_map_route_source_get().
1071 EAPI void elm_map_route_source_set(Evas_Object *obj, Elm_Map_Route_Sources source) EINA_ARG_NONNULL(1);
1074 * Get the current route source.
1076 * @param obj The map object.
1077 * @return The source of the route service used by the map.
1079 * @see elm_map_route_source_set() for details.
1083 EAPI Elm_Map_Route_Sources elm_map_route_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1086 * Set the minimum zoom of the source.
1088 * @param obj The map object.
1089 * @param zoom New minimum zoom value to be used.
1091 * By default, it's 0.
1095 EAPI void elm_map_source_zoom_min_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
1098 * Get the minimum zoom of the source.
1100 * @param obj The map object.
1101 * @return Returns the minimum zoom of the source.
1103 * @see elm_map_source_zoom_min_set() for details.
1107 EAPI int elm_map_source_zoom_min_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1110 * Set the maximum zoom of the source.
1112 * @param obj The map object.
1113 * @param zoom New maximum zoom value to be used.
1115 * By default, it's 18.
1119 EAPI void elm_map_source_zoom_max_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
1122 * Get the maximum zoom of the source.
1124 * @param obj The map object.
1125 * @return Returns the maximum zoom of the source.
1127 * @see elm_map_source_zoom_min_set() for details.
1131 EAPI int elm_map_source_zoom_max_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1134 * Set the user agent used by the map object to access routing services.
1136 * @param obj The map object.
1137 * @param user_agent The user agent to be used by the map.
1139 * User agent is a client application implementing a network protocol used
1140 * in communications within a client–server distributed computing system
1142 * The @p user_agent identification string will transmitted in a header
1143 * field @c User-Agent.
1145 * @see elm_map_user_agent_get()
1149 EAPI void elm_map_user_agent_set(Evas_Object *obj, const char *user_agent) EINA_ARG_NONNULL(1, 2);
1152 * Get the user agent used by the map object.
1154 * @param obj The map object.
1155 * @return The user agent identification string used by the map.
1157 * @see elm_map_user_agent_set() for details.
1161 EAPI const char *elm_map_user_agent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1164 * Add a new route to the map object.
1166 * @param obj The map object.
1167 * @param type The type of transport to be considered when tracing a route.
1168 * @param method The routing method, what should be priorized.
1169 * @param flon The start longitude.
1170 * @param flat The start latitude.
1171 * @param tlon The destination longitude.
1172 * @param tlat The destination latitude.
1174 * @return The created route or @c NULL upon failure.
1176 * A route will be traced by point on coordinates (@p flat, @p flon)
1177 * to point on coordinates (@p tlat, @p tlon), using the route service
1178 * set with elm_map_route_source_set().
1180 * It will take @p type on consideration to define the route,
1181 * depending if the user will be walking or driving, the route may vary.
1182 * One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or
1183 * #ELM_MAP_ROUTE_TYPE_FOOT need to be used.
1185 * Another parameter is what the route should priorize, the minor distance
1186 * or the less time to be spend on the route. So @p method should be one
1187 * of #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST.
1189 * Routes created with this method can be deleted with
1190 * elm_map_route_remove(), colored with elm_map_route_color_set(),
1191 * and distance can be get with elm_map_route_distance_get().
1193 * @see elm_map_route_remove()
1194 * @see elm_map_route_color_set()
1195 * @see elm_map_route_distance_get()
1196 * @see elm_map_route_source_set()
1200 EAPI Elm_Map_Route *elm_map_route_add(Evas_Object *obj, Elm_Map_Route_Type type, Elm_Map_Route_Method method, double flon, double flat, double tlon, double tlat) EINA_ARG_NONNULL(1);
1203 * Remove a route from the map.
1205 * @param route The route to remove.
1207 * @see elm_map_route_add()
1211 EAPI void elm_map_route_remove(Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1214 * Set the route color.
1216 * @param route The route object.
1217 * @param r Red channel value, from 0 to 255.
1218 * @param g Green channel value, from 0 to 255.
1219 * @param b Blue channel value, from 0 to 255.
1220 * @param a Alpha channel value, from 0 to 255.
1222 * It uses an additive color model, so each color channel represents
1223 * how much of each primary colors must to be used. 0 represents
1224 * ausence of this color, so if all of the three are set to 0,
1225 * the color will be black.
1227 * These component values should be integers in the range 0 to 255,
1228 * (single 8-bit byte).
1230 * This sets the color used for the route. By default, it is set to
1231 * solid red (r = 255, g = 0, b = 0, a = 255).
1233 * For alpha channel, 0 represents completely transparent, and 255, opaque.
1235 * @see elm_map_route_color_get()
1239 EAPI void elm_map_route_color_set(Elm_Map_Route *route, int r, int g, int b, int a) EINA_ARG_NONNULL(1);
1242 * Get the route color.
1244 * @param route The route object.
1245 * @param r Pointer where to store the red channel value.
1246 * @param g Pointer where to store the green channel value.
1247 * @param b Pointer where to store the blue channel value.
1248 * @param a Pointer where to store the alpha channel value.
1250 * @see elm_map_route_color_set() for details.
1254 EAPI void elm_map_route_color_get(const Elm_Map_Route *route, int *r, int *g, int *b, int *a) EINA_ARG_NONNULL(1);
1257 * Get the route distance in kilometers.
1259 * @param route The route object.
1260 * @return The distance of route (unit : km).
1264 EAPI double elm_map_route_distance_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1267 * Get the information of route nodes.
1269 * @param route The route object.
1270 * @return Returns a string with the nodes of route.
1274 EAPI const char *elm_map_route_node_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1277 * Get the information of route waypoint.
1279 * @param route the route object.
1280 * @return Returns a string with information about waypoint of route.
1284 EAPI const char *elm_map_route_waypoint_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1287 * Get the address of the name.
1289 * @param name The name handle.
1290 * @return Returns the address string of @p name.
1292 * This gets the coordinates of the @p name, created with one of the
1293 * conversion functions.
1295 * @see elm_map_utils_convert_name_into_coord()
1296 * @see elm_map_utils_convert_coord_into_name()
1300 EAPI const char *elm_map_name_address_get(const Elm_Map_Name *name) EINA_ARG_NONNULL(1);
1303 * Get the current coordinates of the name.
1305 * @param name The name handle.
1306 * @param lat Pointer where to store the latitude.
1307 * @param lon Pointer where to store The longitude.
1309 * This gets the coordinates of the @p name, created with one of the
1310 * conversion functions.
1312 * @see elm_map_utils_convert_name_into_coord()
1313 * @see elm_map_utils_convert_coord_into_name()
1317 EAPI void elm_map_name_region_get(const Elm_Map_Name *name, double *lon, double *lat) EINA_ARG_NONNULL(1);
1320 * Remove a name from the map.
1322 * @param name The name to remove.
1324 * Basically the struct handled by @p name will be freed, so convertions
1325 * between address and coordinates will be lost.
1327 * @see elm_map_utils_convert_name_into_coord()
1328 * @see elm_map_utils_convert_coord_into_name()
1332 EAPI void elm_map_name_remove(Elm_Map_Name *name) EINA_ARG_NONNULL(1);
1337 * @param obj The map object.
1338 * @param degree Angle from 0.0 to 360.0 to rotate arount Z axis.
1339 * @param cx Rotation's center horizontal position.
1340 * @param cy Rotation's center vertical position.
1342 * @see elm_map_rotate_get()
1346 EAPI void elm_map_rotate_set(Evas_Object *obj, double degree, Evas_Coord cx, Evas_Coord cy) EINA_ARG_NONNULL(1);
1349 * Get the rotate degree of the map
1351 * @param obj The map object
1352 * @param degree Pointer where to store degrees from 0.0 to 360.0
1353 * to rotate arount Z axis.
1354 * @param cx Pointer where to store rotation's center horizontal position.
1355 * @param cy Pointer where to store rotation's center vertical position.
1357 * @see elm_map_rotate_set() to set map rotation.
1361 EAPI void elm_map_rotate_get(const Evas_Object *obj, double *degree, Evas_Coord *cx, Evas_Coord *cy) EINA_ARG_NONNULL(1, 2, 3, 4);
1364 * Enable or disable mouse wheel to be used to zoom in / out the map.
1366 * @param obj The map object.
1367 * @param disabled Use @c EINA_TRUE to disable mouse wheel or @c EINA_FALSE
1370 * Mouse wheel can be used for the user to zoom in or zoom out the map.
1372 * It's disabled by default.
1374 * @see elm_map_wheel_disabled_get()
1378 EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1);
1381 * Get a value whether mouse wheel is enabled or not.
1383 * @param obj The map object.
1384 * @return @c EINA_TRUE means map is disabled. @c EINA_FALSE indicates
1385 * it is enabled. If @p obj is @c NULL, @c EINA_FALSE is returned.
1387 * Mouse wheel can be used for the user to zoom in or zoom out the map.
1389 * @see elm_map_wheel_disabled_set() for details.
1393 EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1397 * Add a track on the map
1399 * @param obj The map object.
1400 * @param emap The emap route object.
1401 * @return The route object. This is an elm object of type Route.
1403 * @see elm_route_add() for details.
1407 EAPI Evas_Object *elm_map_track_add(Evas_Object *obj, EMap_Route *emap) EINA_ARG_NONNULL(1);
1411 * Remove a track from the map
1413 * @param obj The map object.
1414 * @param route The track to remove.
1418 EAPI void elm_map_track_remove(Evas_Object *obj, Evas_Object *route) EINA_ARG_NONNULL(1);