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.
193 EAPI Evas_Object *elm_map_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
196 * Set the zoom level of the map.
198 * @param obj The map object.
199 * @param zoom The zoom level to set.
201 * This sets the zoom level.
203 * It will respect limits defined by elm_map_source_zoom_min_set() and
204 * elm_map_source_zoom_max_set().
206 * By default these values are 0 (world map) and 18 (maximum zoom).
208 * This function should be used when zoom mode is set to
209 * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set
210 * with elm_map_zoom_mode_set().
212 * @see elm_map_zoom_mode_set().
213 * @see elm_map_zoom_get().
217 EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
220 * Get the zoom level of the map.
222 * @param obj The map object.
223 * @return The current zoom level.
225 * This returns the current zoom level of the map object.
227 * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
228 * (which is the default), the zoom level may be changed at any time by the
229 * map object itself to account for map size and map viewport size.
231 * @see elm_map_zoom_set() for details.
235 EAPI int elm_map_zoom_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
238 * Set the zoom mode used by the map object.
240 * @param obj The map object.
241 * @param mode The zoom mode of the map, being it one of
242 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
243 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
245 * This sets the zoom mode to manual or one of the automatic levels.
246 * Manual (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
247 * elm_map_zoom_set() and will stay at that level until changed by code
248 * or until zoom mode is changed. This is the default mode.
250 * The Automatic modes will allow the map object to automatically
251 * adjust zoom mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will
252 * adjust zoom so the map fits inside the scroll frame with no pixels
253 * outside this area. #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but
254 * ensure no pixels within the frame are left unfilled. Do not forget that
255 * the valid sizes are 2^zoom, consequently the map may be smaller than
258 * @see elm_map_zoom_set()
262 EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode) EINA_ARG_NONNULL(1);
265 * Get the zoom mode used by the map object.
267 * @param obj The map object.
268 * @return The zoom mode of the map, being it one of
269 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
270 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
272 * This function returns the current zoom mode used by the map object.
274 * @see elm_map_zoom_mode_set() for more details.
278 EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
281 * Get the current coordinates of the map.
283 * @param obj The map object.
284 * @param lon Pointer where to store longitude.
285 * @param lat Pointer where to store latitude.
287 * This gets the current center coordinates of the map object. It can be
288 * set by elm_map_geo_region_bring_in() and elm_map_geo_region_show().
290 * @see elm_map_geo_region_bring_in()
291 * @see elm_map_geo_region_show()
295 EAPI void elm_map_geo_region_get(const Evas_Object *obj, double *lon, double *lat) EINA_ARG_NONNULL(1);
298 * Animatedly bring in given coordinates to the center of the map.
300 * @param obj The map object.
301 * @param lon Longitude to center at.
302 * @param lat Latitude to center at.
304 * This causes map to jump to the given @p lat and @p lon coordinates
305 * and show it (by scrolling) in the center of the viewport, if it is not
306 * already centered. This will use animation to do so and take a period
307 * of time to complete.
309 * @see elm_map_geo_region_show() for a function to avoid animation.
310 * @see elm_map_geo_region_get()
314 EAPI void elm_map_geo_region_bring_in(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
317 * Show the given coordinates at the center of the map, @b immediately.
319 * @param obj The map object.
320 * @param lon Longitude to center at.
321 * @param lat Latitude to center at.
323 * This causes map to @b redraw its viewport's contents to the
324 * region contining the given @p lat and @p lon, that will be moved to the
327 * @see elm_map_geo_region_bring_in() for a function to move with animation.
328 * @see elm_map_geo_region_get()
332 EAPI void elm_map_geo_region_show(Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
335 * Pause or unpause the map.
337 * @param obj The map object.
338 * @param paused Use @c EINA_TRUE to pause the map @p obj or @c EINA_FALSE
341 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
344 * The default is off.
346 * This will stop zooming using animation, changing zoom levels will
347 * change instantly. This will stop any existing animations that are running.
349 * @see elm_map_paused_get()
353 EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1);
356 * Get a value whether map is paused or not.
358 * @param obj The map object.
359 * @return @c EINA_TRUE means map is pause. @c EINA_FALSE indicates
360 * it is not. If @p obj is @c NULL, @c EINA_FALSE is returned.
362 * This gets the current paused state for the map object.
364 * @see elm_map_paused_set() for details.
368 EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
371 * Set to show markers during zoom level changes or not.
373 * @param obj The map object.
374 * @param paused Use @c EINA_TRUE to @b not show markers or @c EINA_FALSE
377 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
380 * The default is off.
382 * This will stop zooming using animation, changing zoom levels will
383 * change instantly. This will stop any existing animations that are running.
385 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
388 * The default is off.
390 * Enabling it will force the map to stop displaying the markers during
391 * zoom level changes. Set to on if you have a large number of markers.
393 * @see elm_map_paused_markers_get()
397 EAPI void elm_map_paused_markers_set(Evas_Object *obj, Eina_Bool paused) EINA_ARG_NONNULL(1);
400 * Get a value whether markers will be displayed on zoom level changes or not
402 * @param obj The map object.
403 * @return @c EINA_TRUE means map @b won't display markers or @c EINA_FALSE
404 * indicates it will. If @p obj is @c NULL, @c EINA_FALSE is returned.
406 * This gets the current markers paused state for the map object.
408 * @see elm_map_paused_markers_set() for details.
412 EAPI Eina_Bool elm_map_paused_markers_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
415 * Get the information of downloading status.
417 * @param obj The map object.
418 * @param try_num Pointer where to store number of tiles being downloaded.
419 * @param finish_num Pointer where to store number of tiles successfully
422 * This gets the current downloading status for the map object, the number
423 * of tiles being downloaded and the number of tiles already downloaded.
427 EAPI void elm_map_utils_downloading_status_get(const Evas_Object *obj, int *try_num, int *finish_num) EINA_ARG_NONNULL(1, 2, 3);
430 * Convert a pixel coordinate (x,y) into a geographic coordinate
431 * (longitude, latitude).
433 * @param obj The map object.
434 * @param x the coordinate.
435 * @param y the coordinate.
436 * @param size the size in pixels of the map.
437 * The map is a square and generally his size is : pow(2.0, zoom)*256.
438 * @param lon Pointer where to store the longitude that correspond to x.
439 * @param lat Pointer where to store the latitude that correspond to y.
441 * @note Origin pixel point is the top left corner of the viewport.
442 * Map zoom and size are taken on account.
444 * @see elm_map_utils_convert_geo_into_coord() if you need the inverse.
448 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);
451 * Convert a geographic coordinate (longitude, latitude) into a pixel
454 * @param obj The map object.
455 * @param lon the longitude.
456 * @param lat the latitude.
457 * @param size the size in pixels of the map. The map is a square
458 * and generally his size is : pow(2.0, zoom)*256.
459 * @param x Pointer where to store the horizontal pixel coordinate that
460 * correspond to the longitude.
461 * @param y Pointer where to store the vertical pixel coordinate that
462 * correspond to the latitude.
464 * @note Origin pixel point is the top left corner of the viewport.
465 * Map zoom and size are taken on account.
467 * @see elm_map_utils_convert_coord_into_geo() if you need the inverse.
471 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);
474 * Convert a geographic coordinate (longitude, latitude) into a name
477 * @param obj The map object.
478 * @param lon the longitude.
479 * @param lat the latitude.
480 * @return name A #Elm_Map_Name handle for this coordinate.
482 * To get the string for this address, elm_map_name_address_get()
485 * @see elm_map_utils_convert_name_into_coord() if you need the inverse.
489 EAPI Elm_Map_Name *elm_map_utils_convert_coord_into_name(const Evas_Object *obj, double lon, double lat) EINA_ARG_NONNULL(1);
492 * Convert a name (address) into a geographic coordinate
493 * (longitude, latitude).
495 * @param obj The map object.
496 * @param name The address.
497 * @return name A #Elm_Map_Name handle for this address.
499 * To get the longitude and latitude, elm_map_name_region_get()
502 * @see elm_map_utils_convert_coord_into_name() if you need the inverse.
506 EAPI Elm_Map_Name *elm_map_utils_convert_name_into_coord(const Evas_Object *obj, char *address) EINA_ARG_NONNULL(1, 2);
509 * Convert a pixel coordinate into a rotated pixel coordinate.
511 * @param obj The map object.
512 * @param x horizontal coordinate of the point to rotate.
513 * @param y vertical coordinate of the point to rotate.
514 * @param cx rotation's center horizontal position.
515 * @param cy rotation's center vertical position.
516 * @param degree amount of degrees from 0.0 to 360.0 to rotate arount Z axis.
517 * @param xx Pointer where to store rotated x.
518 * @param yy Pointer where to store rotated y.
522 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);
525 * Add a new marker to the map object.
527 * @param obj The map object.
528 * @param lon The longitude of the marker.
529 * @param lat The latitude of the marker.
530 * @param clas The class, to use when marker @b isn't grouped to others.
531 * @param clas_group The class group, to use when marker is grouped to others
532 * @param data The data passed to the callbacks.
534 * @return The created marker or @c NULL upon failure.
536 * A marker will be created and shown in a specific point of the map, defined
537 * by @p lon and @p lat.
539 * It will be displayed using style defined by @p class when this marker
540 * is displayed alone (not grouped). A new class can be created with
541 * elm_map_marker_class_new().
543 * If the marker is grouped to other markers, it will be displayed with
544 * style defined by @p class_group. Markers with the same group are grouped
545 * if they are close. A new group class can be created with
546 * elm_map_marker_group_class_new().
548 * Markers created with this method can be deleted with
549 * elm_map_marker_remove().
551 * A marker can have associated content to be displayed by a bubble,
552 * when a user click over it, as well as an icon. These objects will
553 * be fetch using class' callback functions.
555 * @see elm_map_marker_class_new()
556 * @see elm_map_marker_group_class_new()
557 * @see elm_map_marker_remove()
561 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);
564 * Set the maximum numbers of markers' content to be displayed in a group.
566 * @param obj The map object.
567 * @param max The maximum numbers of items displayed in a bubble.
569 * A bubble will be displayed when the user clicks over the group,
570 * and will place the content of markers that belong to this group
573 * A group can have a long list of markers, consequently the creation
574 * of the content of the bubble can be very slow.
576 * In order to avoid this, a maximum number of items is displayed
579 * By default this number is 30.
581 * Marker with the same group class are grouped if they are close.
583 * @see elm_map_marker_add()
587 EAPI void elm_map_max_marker_per_group_set(Evas_Object *obj, int max) EINA_ARG_NONNULL(1);
590 * Remove a marker from the map.
592 * @param marker The marker to remove.
594 * @see elm_map_marker_add()
598 EAPI void elm_map_marker_remove(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
601 * Get the current coordinates of the marker.
603 * @param marker marker.
604 * @param lat Pointer where to store the marker's latitude.
605 * @param lon Pointer where to store the marker's longitude.
607 * These values are set when adding markers, with function
608 * elm_map_marker_add().
610 * @see elm_map_marker_add()
614 EAPI void elm_map_marker_region_get(const Elm_Map_Marker *marker, double *lon, double *lat) EINA_ARG_NONNULL(1);
617 * Animatedly bring in given marker to the center of the map.
619 * @param marker The marker to center at.
621 * This causes map to jump to the given @p marker's coordinates
622 * and show it (by scrolling) in the center of the viewport, if it is not
623 * already centered. This will use animation to do so and take a period
624 * of time to complete.
626 * @see elm_map_marker_show() for a function to avoid animation.
627 * @see elm_map_marker_region_get()
631 EAPI void elm_map_marker_bring_in(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
634 * Show the given marker at the center of the map, @b immediately.
636 * @param marker The marker to center at.
638 * This causes map to @b redraw its viewport's contents to the
639 * region contining the given @p marker's coordinates, that will be
640 * moved to the center of the map.
642 * @see elm_map_marker_bring_in() for a function to move with animation.
643 * @see elm_map_markers_list_show() if more than one marker need to be
645 * @see elm_map_marker_region_get()
649 EAPI void elm_map_marker_show(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
652 * Move and zoom the map to display a list of markers.
654 * @param markers A list of #Elm_Map_Marker handles.
656 * The map will be centered on the center point of the markers in the list.
657 * Then the map will be zoomed in order to fit the markers using the maximum
658 * zoom which allows display of all the markers.
660 * @warning All the markers should belong to the same map object.
662 * @see elm_map_marker_show() to show a single marker.
663 * @see elm_map_marker_bring_in()
667 EAPI void elm_map_markers_list_show(Eina_List *markers) EINA_ARG_NONNULL(1);
670 * Get the Evas object returned by the ElmMapMarkerGetFunc callback
672 * @param marker The marker wich content should be returned.
673 * @return Return the evas object if it exists, else @c NULL.
675 * To set callback function #ElmMapMarkerGetFunc for the marker class,
676 * elm_map_marker_class_get_cb_set() should be used.
678 * This content is what will be inside the bubble that will be displayed
679 * when an user clicks over the marker.
681 * This returns the actual Evas object used to be placed inside
682 * the bubble. This may be @c NULL, as it may
683 * not have been created or may have been deleted, at any time, by
684 * the map. <b>Do not modify this object</b> (move, resize,
685 * show, hide, etc.), as the map is controlling it. This
686 * function is for querying, emitting custom signals or hooking
687 * lower level callbacks for events on that object. Do not delete
688 * this object under any circumstances.
692 EAPI Evas_Object *elm_map_marker_object_get(const Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
697 * @param marker The marker to be updated.
699 * If a content is set to this marker, it will call function to delete it,
700 * #ElmMapMarkerDelFunc, and then will fetch the content again with
701 * #ElmMapMarkerGetFunc.
703 * These functions are set for the marker class with
704 * elm_map_marker_class_get_cb_set() and elm_map_marker_class_del_cb_set().
708 EAPI void elm_map_marker_update(Elm_Map_Marker *marker) EINA_ARG_NONNULL(1);
711 * Close all the bubbles opened by the user.
713 * @param obj The map object.
715 * A bubble is displayed with a content fetched with #ElmMapMarkerGetFunc
716 * when the user clicks on a marker.
718 * This functions is set for the marker class with
719 * elm_map_marker_class_get_cb_set().
723 EAPI void elm_map_bubbles_close(Evas_Object *obj) EINA_ARG_NONNULL(1);
726 * Create a new group class.
728 * @param obj The map object.
729 * @return Returns the new group class.
731 * Each marker must be associated to a group class. Markers in the same
732 * group are grouped if they are close.
734 * The group class defines the style of the marker when a marker is grouped
735 * to others markers. When it is alone, another class will be used.
737 * A group class will need to be provided when creating a marker with
738 * elm_map_marker_add().
740 * Some properties and functions can be set by class, as:
741 * - style, with elm_map_group_class_style_set()
742 * - data - to be associated to the group class. It can be set using
743 * elm_map_group_class_data_set().
744 * - min zoom to display markers, set with
745 * elm_map_group_class_zoom_displayed_set().
746 * - max zoom to group markers, set using
747 * elm_map_group_class_zoom_grouped_set().
748 * - visibility - set if markers will be visible or not, set with
749 * elm_map_group_class_hide_set().
750 * - #ElmMapGroupIconGetFunc - used to fetch icon for markers group classes.
751 * It can be set using elm_map_group_class_icon_cb_set().
753 * @see elm_map_marker_add()
754 * @see elm_map_group_class_style_set()
755 * @see elm_map_group_class_data_set()
756 * @see elm_map_group_class_zoom_displayed_set()
757 * @see elm_map_group_class_zoom_grouped_set()
758 * @see elm_map_group_class_hide_set()
759 * @see elm_map_group_class_icon_cb_set()
763 EAPI Elm_Map_Group_Class *elm_map_group_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1);
766 * Set the marker's style of a group class.
768 * @param clas The group class.
769 * @param style The style to be used by markers.
771 * Each marker must be associated to a group class, and will use the style
772 * defined by such class when grouped to other markers.
774 * The following styles are provided by default theme:
775 * @li @c radio - blue circle
776 * @li @c radio2 - green circle
779 * @see elm_map_group_class_new() for more details.
780 * @see elm_map_marker_add()
784 EAPI void elm_map_group_class_style_set(Elm_Map_Group_Class *clas, const char *style) EINA_ARG_NONNULL(1);
787 * Set the icon callback function of a group class.
789 * @param clas The group class.
790 * @param icon_get The callback function that will return the icon.
792 * Each marker must be associated to a group class, and it can display a
793 * custom icon. The function @p icon_get must return this icon.
795 * @see elm_map_group_class_new() for more details.
796 * @see elm_map_marker_add()
800 EAPI void elm_map_group_class_icon_cb_set(Elm_Map_Group_Class *clas, ElmMapGroupIconGetFunc icon_get) EINA_ARG_NONNULL(1);
803 * Set the data associated to the group class.
805 * @param clas The group class.
806 * @param data The new user data.
808 * This data will be passed for callback functions, like icon get callback,
809 * that can be set with elm_map_group_class_icon_cb_set().
811 * If a data was previously set, the object will lose the pointer for it,
812 * so if needs to be freed, you must do it yourself.
814 * @see elm_map_group_class_new() for more details.
815 * @see elm_map_group_class_icon_cb_set()
816 * @see elm_map_marker_add()
820 EAPI void elm_map_group_class_data_set(Elm_Map_Group_Class *clas, void *data) EINA_ARG_NONNULL(1);
823 * Set the minimum zoom from where the markers are displayed.
825 * @param clas The group class.
826 * @param zoom The minimum zoom.
828 * Markers only will be displayed when the map is displayed at @p zoom
831 * @see elm_map_group_class_new() for more details.
832 * @see elm_map_marker_add()
836 EAPI void elm_map_group_class_zoom_displayed_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1);
839 * Set the zoom from where the markers are no more grouped.
841 * @param clas The group class.
842 * @param zoom The maximum zoom.
844 * Markers only will be grouped when the map is displayed at
847 * @see elm_map_group_class_new() for more details.
848 * @see elm_map_marker_add()
852 EAPI void elm_map_group_class_zoom_grouped_set(Elm_Map_Group_Class *clas, int zoom) EINA_ARG_NONNULL(1);
855 * Set if the markers associated to the group class @clas are hidden or not.
857 * @param clas The group class.
858 * @param hide Use @c EINA_TRUE to hide markers or @c EINA_FALSE
861 * If @p hide is @c EINA_TRUE the markers will be hidden, but default
866 EAPI void elm_map_group_class_hide_set(Evas_Object *obj, Elm_Map_Group_Class *clas, Eina_Bool hide) EINA_ARG_NONNULL(1, 2);
869 * Create a new marker class.
871 * @param obj The map object.
872 * @return Returns the new group class.
874 * Each marker must be associated to a class.
876 * The marker class defines the style of the marker when a marker is
877 * displayed alone, i.e., not grouped to to others markers. When grouped
878 * it will use group class style.
880 * A marker class will need to be provided when creating a marker with
881 * elm_map_marker_add().
883 * Some properties and functions can be set by class, as:
884 * - style, with elm_map_marker_class_style_set()
885 * - #ElmMapMarkerIconGetFunc - used to fetch icon for markers classes.
886 * It can be set using elm_map_marker_class_icon_cb_set().
887 * - #ElmMapMarkerGetFunc - used to fetch bubble content for marker classes.
888 * Set using elm_map_marker_class_get_cb_set().
889 * - #ElmMapMarkerDelFunc - used to delete bubble content for marker classes.
890 * Set using elm_map_marker_class_del_cb_set().
892 * @see elm_map_marker_add()
893 * @see elm_map_marker_class_style_set()
894 * @see elm_map_marker_class_icon_cb_set()
895 * @see elm_map_marker_class_get_cb_set()
896 * @see elm_map_marker_class_del_cb_set()
900 EAPI Elm_Map_Marker_Class *elm_map_marker_class_new(Evas_Object *obj) EINA_ARG_NONNULL(1);
903 * Set the marker's style of a marker class.
905 * @param clas The marker class.
906 * @param style The style to be used by markers.
908 * Each marker must be associated to a marker class, and will use the style
909 * defined by such class when alone, i.e., @b not grouped to other markers.
911 * The following styles are provided by default theme:
916 * @see elm_map_marker_class_new() for more details.
917 * @see elm_map_marker_add()
921 EAPI void elm_map_marker_class_style_set(Elm_Map_Marker_Class *clas, const char *style) EINA_ARG_NONNULL(1);
924 * Set the icon callback function of a marker class.
926 * @param clas The marker class.
927 * @param icon_get The callback function that will return the icon.
929 * Each marker must be associated to a marker class, and it can display a
930 * custom icon. The function @p icon_get must return this icon.
932 * @see elm_map_marker_class_new() for more details.
933 * @see elm_map_marker_add()
937 EAPI void elm_map_marker_class_icon_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerIconGetFunc icon_get) EINA_ARG_NONNULL(1);
940 * Set the bubble content callback function of a marker class.
942 * @param clas The marker class.
943 * @param get The callback function that will return the content.
945 * Each marker must be associated to a marker class, and it can display a
946 * a content on a bubble that opens when the user click over the marker.
947 * The function @p get must return this content object.
949 * If this content will need to be deleted, elm_map_marker_class_del_cb_set()
952 * @see elm_map_marker_class_new() for more details.
953 * @see elm_map_marker_class_del_cb_set()
954 * @see elm_map_marker_add()
958 EAPI void elm_map_marker_class_get_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerGetFunc get) EINA_ARG_NONNULL(1);
961 * Set the callback function used to delete bubble content of a marker class.
963 * @param clas The marker class.
964 * @param del The callback function that will delete the content.
966 * Each marker must be associated to a marker class, and it can display a
967 * a content on a bubble that opens when the user click over the marker.
968 * The function to return such content can be set with
969 * elm_map_marker_class_get_cb_set().
971 * If this content must be freed, a callback function need to be
972 * set for that task with this function.
974 * If this callback is defined it will have to delete (or not) the
975 * object inside, but if the callback is not defined the object will be
976 * destroyed with evas_object_del().
978 * @see elm_map_marker_class_new() for more details.
979 * @see elm_map_marker_class_get_cb_set()
980 * @see elm_map_marker_add()
984 EAPI void elm_map_marker_class_del_cb_set(Elm_Map_Marker_Class *clas, ElmMapMarkerDelFunc del) EINA_ARG_NONNULL(1);
987 * Get the list of available sources.
989 * @param obj The map object.
990 * @return The source names list.
992 * It will provide a list with all available sources, that can be set as
993 * current source with elm_map_source_name_set(), or get with
994 * elm_map_source_name_get().
1002 * @see elm_map_source_name_set() for more details.
1003 * @see elm_map_source_name_get()
1007 EAPI const char **elm_map_source_names_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1010 * Set the source of the map.
1012 * @param obj The map object.
1013 * @param source The source to be used.
1015 * Map widget retrieves images that composes the map from a web service.
1016 * This web service can be set with this method.
1018 * A different service can return a different maps with different
1019 * information and it can use different zoom values.
1021 * The @p source_name need to match one of the names provided by
1022 * elm_map_source_names_get().
1024 * The current source can be get using elm_map_source_name_get().
1026 * @see elm_map_source_names_get()
1027 * @see elm_map_source_name_get()
1032 EAPI void elm_map_source_name_set(Evas_Object *obj, const char *source_name) EINA_ARG_NONNULL(1);
1035 * Get the name of currently used source.
1037 * @param obj The map object.
1038 * @return Returns the name of the source in use.
1040 * @see elm_map_source_name_set() for more details.
1044 EAPI const char *elm_map_source_name_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1047 * Set the source of the route service to be used by the map.
1049 * @param obj The map object.
1050 * @param source The route service to be used, being it one of
1051 * #ELM_MAP_ROUTE_SOURCE_YOURS (default), #ELM_MAP_ROUTE_SOURCE_MONAV,
1052 * and #ELM_MAP_ROUTE_SOURCE_ORS.
1054 * Each one has its own algorithm, so the route retrieved may
1055 * differ depending on the source route. Now, only the default is working.
1057 * #ELM_MAP_ROUTE_SOURCE_YOURS is the routing service provided at
1058 * http://www.yournavigation.org/.
1060 * #ELM_MAP_ROUTE_SOURCE_MONAV, offers exact routing without heuristic
1061 * assumptions. Its routing core is based on Contraction Hierarchies.
1063 * #ELM_MAP_ROUTE_SOURCE_ORS, is provided at http://www.openrouteservice.org/
1065 * @see elm_map_route_source_get().
1069 EAPI void elm_map_route_source_set(Evas_Object *obj, Elm_Map_Route_Sources source) EINA_ARG_NONNULL(1);
1072 * Get the current route source.
1074 * @param obj The map object.
1075 * @return The source of the route service used by the map.
1077 * @see elm_map_route_source_set() for details.
1081 EAPI Elm_Map_Route_Sources elm_map_route_source_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1084 * Set the minimum zoom of the source.
1086 * @param obj The map object.
1087 * @param zoom New minimum zoom value to be used.
1089 * By default, it's 0.
1093 EAPI void elm_map_source_zoom_min_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
1096 * Get the minimum zoom of the source.
1098 * @param obj The map object.
1099 * @return Returns the minimum zoom of the source.
1101 * @see elm_map_source_zoom_min_set() for details.
1105 EAPI int elm_map_source_zoom_min_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1108 * Set the maximum zoom of the source.
1110 * @param obj The map object.
1111 * @param zoom New maximum zoom value to be used.
1113 * By default, it's 18.
1117 EAPI void elm_map_source_zoom_max_set(Evas_Object *obj, int zoom) EINA_ARG_NONNULL(1);
1120 * Get the maximum zoom of the source.
1122 * @param obj The map object.
1123 * @return Returns the maximum zoom of the source.
1125 * @see elm_map_source_zoom_min_set() for details.
1129 EAPI int elm_map_source_zoom_max_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1132 * Set the user agent used by the map object to access routing services.
1134 * @param obj The map object.
1135 * @param user_agent The user agent to be used by the map.
1137 * User agent is a client application implementing a network protocol used
1138 * in communications within a client–server distributed computing system
1140 * The @p user_agent identification string will transmitted in a header
1141 * field @c User-Agent.
1143 * @see elm_map_user_agent_get()
1147 EAPI void elm_map_user_agent_set(Evas_Object *obj, const char *user_agent) EINA_ARG_NONNULL(1, 2);
1150 * Get the user agent used by the map object.
1152 * @param obj The map object.
1153 * @return The user agent identification string used by the map.
1155 * @see elm_map_user_agent_set() for details.
1159 EAPI const char *elm_map_user_agent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1162 * Add a new route to the map object.
1164 * @param obj The map object.
1165 * @param type The type of transport to be considered when tracing a route.
1166 * @param method The routing method, what should be priorized.
1167 * @param flon The start longitude.
1168 * @param flat The start latitude.
1169 * @param tlon The destination longitude.
1170 * @param tlat The destination latitude.
1172 * @return The created route or @c NULL upon failure.
1174 * A route will be traced by point on coordinates (@p flat, @p flon)
1175 * to point on coordinates (@p tlat, @p tlon), using the route service
1176 * set with elm_map_route_source_set().
1178 * It will take @p type on consideration to define the route,
1179 * depending if the user will be walking or driving, the route may vary.
1180 * One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or
1181 * #ELM_MAP_ROUTE_TYPE_FOOT need to be used.
1183 * Another parameter is what the route should priorize, the minor distance
1184 * or the less time to be spend on the route. So @p method should be one
1185 * of #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST.
1187 * Routes created with this method can be deleted with
1188 * elm_map_route_remove(), colored with elm_map_route_color_set(),
1189 * and distance can be get with elm_map_route_distance_get().
1191 * @see elm_map_route_remove()
1192 * @see elm_map_route_color_set()
1193 * @see elm_map_route_distance_get()
1194 * @see elm_map_route_source_set()
1198 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);
1201 * Remove a route from the map.
1203 * @param route The route to remove.
1205 * @see elm_map_route_add()
1209 EAPI void elm_map_route_remove(Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1212 * Set the route color.
1214 * @param route The route object.
1215 * @param r Red channel value, from 0 to 255.
1216 * @param g Green channel value, from 0 to 255.
1217 * @param b Blue channel value, from 0 to 255.
1218 * @param a Alpha channel value, from 0 to 255.
1220 * It uses an additive color model, so each color channel represents
1221 * how much of each primary colors must to be used. 0 represents
1222 * ausence of this color, so if all of the three are set to 0,
1223 * the color will be black.
1225 * These component values should be integers in the range 0 to 255,
1226 * (single 8-bit byte).
1228 * This sets the color used for the route. By default, it is set to
1229 * solid red (r = 255, g = 0, b = 0, a = 255).
1231 * For alpha channel, 0 represents completely transparent, and 255, opaque.
1233 * @see elm_map_route_color_get()
1237 EAPI void elm_map_route_color_set(Elm_Map_Route *route, int r, int g , int b, int a) EINA_ARG_NONNULL(1);
1240 * Get the route color.
1242 * @param route The route object.
1243 * @param r Pointer where to store the red channel value.
1244 * @param g Pointer where to store the green channel value.
1245 * @param b Pointer where to store the blue channel value.
1246 * @param a Pointer where to store the alpha channel value.
1248 * @see elm_map_route_color_set() for details.
1252 EAPI void elm_map_route_color_get(const Elm_Map_Route *route, int *r, int *g , int *b, int *a) EINA_ARG_NONNULL(1);
1255 * Get the route distance in kilometers.
1257 * @param route The route object.
1258 * @return The distance of route (unit : km).
1262 EAPI double elm_map_route_distance_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1265 * Get the information of route nodes.
1267 * @param route The route object.
1268 * @return Returns a string with the nodes of route.
1272 EAPI const char *elm_map_route_node_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1275 * Get the information of route waypoint.
1277 * @param route the route object.
1278 * @return Returns a string with information about waypoint of route.
1282 EAPI const char *elm_map_route_waypoint_get(const Elm_Map_Route *route) EINA_ARG_NONNULL(1);
1285 * Get the address of the name.
1287 * @param name The name handle.
1288 * @return Returns the address string of @p name.
1290 * This gets the coordinates of the @p name, created with one of the
1291 * conversion functions.
1293 * @see elm_map_utils_convert_name_into_coord()
1294 * @see elm_map_utils_convert_coord_into_name()
1298 EAPI const char *elm_map_name_address_get(const Elm_Map_Name *name) EINA_ARG_NONNULL(1);
1301 * Get the current coordinates of the name.
1303 * @param name The name handle.
1304 * @param lat Pointer where to store the latitude.
1305 * @param lon Pointer where to store The longitude.
1307 * This gets the coordinates of the @p name, created with one of the
1308 * conversion functions.
1310 * @see elm_map_utils_convert_name_into_coord()
1311 * @see elm_map_utils_convert_coord_into_name()
1315 EAPI void elm_map_name_region_get(const Elm_Map_Name *name, double *lon, double *lat) EINA_ARG_NONNULL(1);
1318 * Remove a name from the map.
1320 * @param name The name to remove.
1322 * Basically the struct handled by @p name will be freed, so convertions
1323 * between address and coordinates will be lost.
1325 * @see elm_map_utils_convert_name_into_coord()
1326 * @see elm_map_utils_convert_coord_into_name()
1330 EAPI void elm_map_name_remove(Elm_Map_Name *name) EINA_ARG_NONNULL(1);
1335 * @param obj The map object.
1336 * @param degree Angle from 0.0 to 360.0 to rotate arount Z axis.
1337 * @param cx Rotation's center horizontal position.
1338 * @param cy Rotation's center vertical position.
1340 * @see elm_map_rotate_get()
1344 EAPI void elm_map_rotate_set(Evas_Object *obj, double degree, Evas_Coord cx, Evas_Coord cy) EINA_ARG_NONNULL(1);
1347 * Get the rotate degree of the map
1349 * @param obj The map object
1350 * @param degree Pointer where to store degrees from 0.0 to 360.0
1351 * to rotate arount Z axis.
1352 * @param cx Pointer where to store rotation's center horizontal position.
1353 * @param cy Pointer where to store rotation's center vertical position.
1355 * @see elm_map_rotate_set() to set map rotation.
1359 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);
1362 * Enable or disable mouse wheel to be used to zoom in / out the map.
1364 * @param obj The map object.
1365 * @param disabled Use @c EINA_TRUE to disable mouse wheel or @c EINA_FALSE
1368 * Mouse wheel can be used for the user to zoom in or zoom out the map.
1370 * It's disabled by default.
1372 * @see elm_map_wheel_disabled_get()
1376 EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled) EINA_ARG_NONNULL(1);
1379 * Get a value whether mouse wheel is enabled or not.
1381 * @param obj The map object.
1382 * @return @c EINA_TRUE means map is disabled. @c EINA_FALSE indicates
1383 * it is enabled. If @p obj is @c NULL, @c EINA_FALSE is returned.
1385 * Mouse wheel can be used for the user to zoom in or zoom out the map.
1387 * @see elm_map_wheel_disabled_set() for details.
1391 EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1395 * Add a track on the map
1397 * @param obj The map object.
1398 * @param emap The emap route object.
1399 * @return The route object. This is an elm object of type Route.
1401 * @see elm_route_add() for details.
1405 EAPI Evas_Object *elm_map_track_add(Evas_Object *obj, EMap_Route *emap) EINA_ARG_NONNULL(1);
1409 * Remove a track from the map
1411 * @param obj The map object.
1412 * @param route The track to remove.
1416 EAPI void elm_map_track_remove(Evas_Object *obj, Evas_Object *route) EINA_ARG_NONNULL(1);