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 * - "clicked,double" - This is called when a user has double-clicked
24 * - "press" - This is called when a user has pressed down on the map.
25 * - "longpressed" - This is called when a user has pressed down on the map
26 * for a long time without dragging around.
27 * - "scroll" - the content has been scrolled (moved).
28 * - "scroll,drag,start" - dragging the contents around has started.
29 * - "scroll,drag,stop" - dragging the contents around has stopped.
30 * - "scroll,anim,start" - scrolling animation has started.
31 * - "scroll,anim,stop" - scrolling animation has stopped.
32 * - "zoom,start" - Zoom animation started.
33 * - "zoom,stop" - Zoom animation stopped.
34 * - "zoom,change" - Zoom changed when using an auto zoom mode.
35 * - "tile,load" - A map tile image load begins.
36 * - "tile,loaded" - A map tile image load ends.
37 * - "tile,loaded,fail" - A map tile image load fails.
38 * - "route,load" - Route request begins.
39 * - "route,loaded" - Route request ends.
40 * - "route,loaded,fail" - Route request fails.
41 * - "name,load" - Name request begins.
42 * - "name,loaded" - Name request ends.
43 * - "name,loaded,fail" - Name request fails.
44 * - "overlay,clicked" - A overlay is clicked.
46 * Available style for map widget:
49 * Available style for markers:
54 * Available style for marker bubble:
58 * @li @ref map_example_01
59 * @li @ref map_example_02
60 * @li @ref map_example_03
69 * Set map's zoom behavior. It can be set to manual or automatic.
71 * Default value is #ELM_MAP_ZOOM_MODE_MANUAL.
73 * Values <b> don't </b> work as bitmask, only one can be chosen.
75 * @note Valid sizes are 2^zoom, consequently the map may be smaller
76 * than the scroller view.
78 * @see elm_map_zoom_mode_set()
79 * @see elm_map_zoom_mode_get()
85 ELM_MAP_ZOOM_MODE_MANUAL, /**< Zoom controlled manually by elm_map_zoom_set(). It's set by default. */
86 ELM_MAP_ZOOM_MODE_AUTO_FIT, /**< Zoom until map fits inside the scroll frame with no pixels outside this area. */
87 ELM_MAP_ZOOM_MODE_AUTO_FILL, /**< Zoom until map fills scroll, ensuring no pixels are left unfilled. */
88 ELM_MAP_ZOOM_MODE_LAST
92 * Set type of a external source (provider).
94 * @see elm_map_sources_get()
95 * @see elm_map_source_get()
96 * @see elm_map_source_set()
102 ELM_MAP_SOURCE_TYPE_TILE, /**< Map tile provider. */
103 ELM_MAP_SOURCE_TYPE_ROUTE, /**< Route service provider. */
104 ELM_MAP_SOURCE_TYPE_NAME, /**< Name service provider. */
105 ELM_MAP_SOURCE_TYPE_LAST
106 } Elm_Map_Source_Type;
109 * Set type of transport used on route.
111 * @see elm_map_route_add()
117 ELM_MAP_ROUTE_TYPE_MOTOCAR, /**< Route should consider an automobile will be used. */
118 ELM_MAP_ROUTE_TYPE_BICYCLE, /**< Route should consider a bicycle will be used by the user. */
119 ELM_MAP_ROUTE_TYPE_FOOT, /**< Route should consider user will be walking. */
120 ELM_MAP_ROUTE_TYPE_LAST
121 } Elm_Map_Route_Type;
124 * Set the routing method, what should be prioritized, time or distance.
126 * @see elm_map_route_add()
132 ELM_MAP_ROUTE_METHOD_FASTEST, /**< Route should prioritize time. */
133 ELM_MAP_ROUTE_METHOD_SHORTEST, /**< Route should prioritized distance. */
134 ELM_MAP_ROUTE_METHOD_LAST
135 } Elm_Map_Route_Method;
138 * Set the name search method.
140 * This is for name module interface.
146 ELM_MAP_NAME_METHOD_SEARCH,
147 ELM_MAP_NAME_METHOD_REVERSE,
148 ELM_MAP_NAME_METHOD_LAST
149 } Elm_Map_Name_Method;
152 * Set overlay type to be used. This type is resolved
153 * when the overlay is created.
154 * You can get this value by elm_map_overlay_type_get().
156 * @see elm_map_overlay_type_get()
157 * @see elm_map_overlay_add()
158 * @see elm_map_overlay_class_add()
159 * @see elm_map_overlay_bubble_add()
163 typedef enum _Elm_Map_Overlay_Type
165 ELM_MAP_OVERLAY_TYPE_NONE = 0,
166 ELM_MAP_OVERLAY_TYPE_DEFAULT,
167 ELM_MAP_OVERLAY_TYPE_CLASS,
168 ELM_MAP_OVERLAY_TYPE_BUBBLE,
169 ELM_MAP_OVERLAY_TYPE_ROUTE,
170 ELM_MAP_OVERLAY_TYPE_GROUP
171 } Elm_Map_Overlay_Type;
173 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(). */
174 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(). */
175 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(). */
176 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(). */
177 typedef struct _Elm_Map_Name Elm_Map_Name; /**< A handle for specific coordinates. */
178 typedef struct _Elm_Map_Overlay Elm_Map_Overlay; /**< A overlay to be shown in a specific point of the map. This can be created by elm_map_overlay_add() and similar functions and deleted by elm_map_overlay_del(). */
180 typedef Evas_Object *(*Elm_Map_Marker_Get_Func)(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. */
181 typedef void (*Elm_Map_Marker_Del_Func)(Evas_Object *obj, Elm_Map_Marker *marker, void *data, Evas_Object *o); /**< Function to delete bubble content for marker classes. */
182 typedef Evas_Object *(*Elm_Map_Marker_Icon_Get_Func)(Evas_Object *obj, Elm_Map_Marker *marker, void *data); /**< Icon fetching class function for marker classes. */
183 typedef Evas_Object *(*Elm_Map_Group_Icon_Get_Func)(Evas_Object *obj, void *data); /**< Icon fetching class function for markers group classes. */
185 typedef void (*Elm_Map_Overlay_Get_Cb)(void *data, Evas_Object *map, Elm_Map_Overlay *overlay); /**< Get callback function for the overlay. */
186 typedef void (*Elm_Map_Name_Cb)(void *data, Evas_Object *map, Elm_Map_Name *name); /**< Async-callback function for the name request. */
187 typedef void (*Elm_Map_Route_Cb)(void *data, Evas_Object *map, Elm_Map_Route *route); /**< Async-callback function for the route request. */
190 * Add a new map widget to the given parent Elementary (container) object.
192 * @param parent The parent object.
193 * @return a new map widget handle or @c NULL, on errors.
195 * This function inserts a new map widget on the canvas.
199 EAPI Evas_Object *elm_map_add(Evas_Object *parent);
202 * Set the zoom level of the map.
204 * @param obj The map object.
205 * @param zoom The zoom level to set.
207 * This sets the zoom level.
209 * It will respect limits defined by elm_map_zoom_min_set() and
210 * elm_map_zoom_max_set().
212 * By default these values are 0 (world map) and 18 (maximum zoom).
214 * This function should be used when zoom mode is set to
215 * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set
216 * with elm_map_zoom_mode_set().
218 * @see elm_map_zoom_mode_set()
219 * @see elm_map_zoom_get()
223 EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom);
226 * Get the zoom level of the map.
228 * @param obj The map object.
229 * @return The current zoom level.
231 * This returns the current zoom level of the map object.
233 * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
234 * (which is the default), the zoom level may be changed at any time by the
235 * map object itself to account for map size and map viewport size.
237 * @see elm_map_zoom_set() for details.
241 EAPI int elm_map_zoom_get(const Evas_Object *obj);
244 * Set the zoom mode used by the map object.
246 * @param obj The map object.
247 * @param mode The zoom mode of the map, being it one of
248 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
249 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
251 * This sets the zoom mode to manual or one of the automatic levels.
252 * Manual (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
253 * elm_map_zoom_set() and will stay at that level until changed by code
254 * or until zoom mode is changed. This is the default mode.
256 * The Automatic modes will allow the map object to automatically
257 * adjust zoom mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will
258 * adjust zoom so the map fits inside the scroll frame with no pixels
259 * outside this area. #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but
260 * ensure no pixels within the frame are left unfilled. Do not forget that
261 * the valid sizes are 2^zoom, consequently the map may be smaller than
264 * @see elm_map_zoom_set()
268 EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode);
271 * Get the zoom mode used by the map object.
273 * @param obj The map object.
274 * @return The zoom mode of the map, being it one of
275 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
276 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
278 * This function returns the current zoom mode used by the map object.
280 * @see elm_map_zoom_mode_set() for more details.
284 EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj);
287 * Set the minimum zoom of the source.
289 * @param obj The map object.
290 * @param zoom New minimum zoom value to be used.
292 * @see elm_map_zoom_min_get() for details.
296 EAPI void elm_map_zoom_min_set(Evas_Object *obj, int zoom);
299 * Get the minimum zoom of the source.
301 * @param obj The map object.
302 * @return Returns the minimum zoom of the source.
304 * @see elm_map_zoom_min_set() for details.
308 EAPI int elm_map_zoom_min_get(const Evas_Object *obj);
311 * Set the maximum zoom of the source.
313 * @param obj The map object.
314 * @param zoom New maximum zoom value to be used.
316 * @see elm_map_zoom_max_get() for details.
320 EAPI void elm_map_zoom_max_set(Evas_Object *obj, int zoom);
323 * Get the maximum zoom of the source.
325 * @param obj The map object.
326 * @return Returns the maximum zoom of the source.
328 * @see elm_map_zoom_max_set() for details.
332 EAPI int elm_map_zoom_max_get(const Evas_Object *obj);
335 * Get the current geographic coordinates of the map.
337 * @param obj The map object.
338 * @param lon Pointer to store longitude.
339 * @param lat Pointer to store latitude.
341 * This gets the current center coordinates of the map object. It can be
342 * set by elm_map_region_bring_in() and elm_map_region_show().
344 * @see elm_map_region_bring_in()
345 * @see elm_map_region_show()
349 EAPI void elm_map_region_get(const Evas_Object *obj, double *lon, double *lat);
352 * Animatedly bring in given coordinates to the center of the map.
354 * @param obj The map object.
355 * @param lon Longitude to center at.
356 * @param lat Latitude to center at.
358 * This causes map to jump to the given @p lat and @p lon coordinates
359 * and show it (by scrolling) in the center of the viewport, if it is not
360 * already centered. This will use animation to do so and take a period
361 * of time to complete.
363 * @see elm_map_region_show() for a function to avoid animation.
364 * @see elm_map_region_get()
368 EAPI void elm_map_region_bring_in(Evas_Object *obj, double lon, double lat);
371 * Show the given coordinates at the center of the map, @b immediately.
373 * @param obj The map object.
374 * @param lon Longitude to center at.
375 * @param lat Latitude to center at.
377 * This causes map to @b redraw its viewport's contents to the
378 * region containing the given @p lat and @p lon, that will be moved to the
381 * @see elm_map_region_bring_in() for a function to move with animation.
382 * @see elm_map_region_get()
386 EAPI void elm_map_region_show(Evas_Object *obj, double lon, double lat);
389 * Convert canvas coordinates into geographic coordinates
390 * (longitude, latitude).
392 * @param obj The map object.
393 * @param x horizontal coordinate of the point to convert.
394 * @param y vertical coordinate of the point to convert.
395 * @param lon A pointer to the longitude.
396 * @param lat A pointer to the latitude.
398 * This gets longitude and latitude from canvas x, y coordinates. The canvas
399 * coordinates mean x, y coordinate from current viewport.
401 * see elm_map_region_to_canvas_convert()
405 EAPI void elm_map_canvas_to_region_convert(const Evas_Object *obj, const Evas_Coord x, const Evas_Coord y, double *lon, double *lat);
408 * Convert geographic coordinates (longitude, latitude)
409 * into canvas coordinates.
411 * @param obj The map object.
412 * @param lon The longitude to convert.
413 * @param lat The latitude to convert.
414 * @param x A pointer to horizontal coordinate.
415 * @param y A pointer to vertical coordinate.
417 * This gets canvas x, y coordinates from longitude and latitude. The canvas
418 * coordinates mean x, y coordinate from current viewport.
420 * see elm_map_canvas_to_region_convert()
424 EAPI void elm_map_region_to_canvas_convert(const Evas_Object *obj, double lon, double lat, Evas_Coord *x, Evas_Coord *y);
427 * Pause or unpause the map.
429 * @param obj The map object.
430 * @param paused Use @c EINA_TRUE to pause the map @p obj or @c EINA_FALSE
433 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
436 * The default is off.
438 * This will stop zooming using animation, changing zoom levels will
439 * change instantly. This will stop any existing animations that are running.
441 * @see elm_map_paused_get()
445 EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused);
448 * Get a value whether map is paused or not.
450 * @param obj The map object.
451 * @return @c EINA_TRUE means map is pause. @c EINA_FALSE indicates
454 * This gets the current paused state for the map object.
456 * @see elm_map_paused_set() for details.
460 EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj);
465 * @param obj The map object.
466 * @param degree Angle from 0.0 to 360.0 to rotate around Z axis.
467 * @param cx Rotation's center horizontal position.
468 * @param cy Rotation's center vertical position.
470 * @see elm_map_rotate_get()
474 EAPI void elm_map_rotate_set(Evas_Object *obj, double degree, Evas_Coord cx, Evas_Coord cy);
477 * Get the rotate degree of the map
479 * @param obj The map object
480 * @param degree Pointer to store degrees from 0.0 to 360.0
481 * to rotate around Z axis.
482 * @param cx Pointer to store rotation's center horizontal position.
483 * @param cy Pointer to store rotation's center vertical position.
485 * @see elm_map_rotate_set() to set map rotation.
489 EAPI void elm_map_rotate_get(const Evas_Object *obj, double *degree, Evas_Coord *cx, Evas_Coord *cy);
492 * Enable or disable mouse wheel to be used to zoom in / out the map.
494 * @param obj The map object.
495 * @param disabled Use @c EINA_TRUE to disable mouse wheel or @c EINA_FALSE
498 * Mouse wheel can be used for the user to zoom in or zoom out the map.
500 * It's disabled by default.
502 * @see elm_map_wheel_disabled_get()
506 EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
509 * Get a value whether mouse wheel is enabled or not.
511 * @param obj The map object.
512 * @return @c EINA_TRUE means map is disabled. @c EINA_FALSE indicates
515 * Mouse wheel can be used for the user to zoom in or zoom out the map.
517 * @see elm_map_wheel_disabled_set() for details.
521 EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);
524 * Set the user agent used by the map object to access routing services.
526 * @param obj The map object.
527 * @param user_agent The user agent to be used by the map.
529 * User agent is a client application implementing a network protocol used
530 * in communications within a client–server distributed computing system
532 * The @p user_agent identification string will transmitted in a header
533 * field @c User-Agent.
535 * @see elm_map_user_agent_get()
539 EAPI void elm_map_user_agent_set(Evas_Object *obj, const char *user_agent);
542 * Get the user agent used by the map object.
544 * @param obj The map object.
545 * @return The user agent identification string used by the map.
547 * @see elm_map_user_agent_set() for details.
551 EAPI const char *elm_map_user_agent_get(const Evas_Object *obj);
555 * Add a new overlay to the map object. This overlay has a default type.
557 * @param obj The map object to add a new overlay.
558 * @param lon The longitude of the overlay.
559 * @param lat The latitude of the overlay.
560 * @return The created overlay or @c NULL upon failure.
562 * A overlay will be created and shown in a specific point of the map, defined
563 * by @p lon and @p lat.
565 * The created overlay has a default style layout before content or
567 * If content or icon is set, those are displayed instead of default style
569 * You can set by using elm_map_overlay_content_set() or
570 * elm_map_overlay_icon_set(). If NULL is set, default style
573 * Overlay created with this method can be deleted by elm_map_overlay_del().
575 * @see elm_map_overlay_del()
576 * @see elm_map_overlay_class_add()
577 * @see elm_map_overlay_bubble_add()
578 * @see elm_map_overlay_content_set()
579 * @see elm_map_overlay_icon_set()
583 EAPI Elm_Map_Overlay * elm_map_overlay_add(Evas_Object *obj, double lon, double lat);
586 * Delete a overlay from the map. This function can delete all types
589 * @param overlay The overlay to be deleted.
591 * @see elm_map_overlay_add()
592 * @see elm_map_overlay_class_add()
593 * @see elm_map_overlay_bubble_add()
597 EAPI void elm_map_overlay_del(Elm_Map_Overlay *overlay);
600 * Get the overlay type.
602 * @param overlay The overlay to return type.
603 * @return Return the overlay type.
605 * This type is resolved when the overlay is created.
607 * @see elm_map_overlay_add()
608 * @see elm_map_overlay_class_add()
609 * @see elm_map_overlay_bubble_add()
613 EAPI Elm_Map_Overlay_Type elm_map_overlay_type_get(const Elm_Map_Overlay *overlay);
616 * Set a pointer of user data for a overlay.
618 * @param overlay The overlay to own the user data.
619 * @param data A pointer of user data
621 * @see elm_map_overlay_data_get()
625 EAPI void elm_map_overlay_data_set(Elm_Map_Overlay *overlay, void *data);
628 * Get the user data stored on a overlay.
630 * @param overlay The overlay to return the user data.
631 * @return A pointer to data stored using elm_map_overlay_data_set(),
632 * or @c NULL, if none has been set.
634 * @see elm_map_overlay_data_set()
638 EAPI void * elm_map_overlay_data_get(const Elm_Map_Overlay *overlay);
641 * Set if the overlay is hidden or not.
643 * @param overlay The overlay to be hidden.
644 * @param hide Use @c EINA_TRUE to hide the overlay or @c EINA_FALSE to show.
646 * @see elm_map_overlay_hide_get()
650 EAPI void elm_map_overlay_hide_set(Elm_Map_Overlay *overlay, Eina_Bool hide);
653 * Get a value whether the overlay is hidden or not.
655 * @param overlay The overlay to return the hidden state.
656 * @return @c EINA_TRUE means the overlay is hidden. @c EINA_FALSE indicates
659 * This gets the current hidden state for the overlay.
661 * @see elm_map_overlay_hide_set()
665 EAPI Eina_Bool elm_map_overlay_hide_get(const Elm_Map_Overlay *overlay);
668 * Set the minimum zoom from where the overlay is displayed.
670 * @param overlay The overlay to be set the minimum zoom.
671 * @param zoom The minimum zoom.
673 * The overlay only will be displayed when the map is displayed at @p zoom
676 * @see elm_map_overlay_displayed_zoom_min_get()
680 EAPI void elm_map_overlay_displayed_zoom_min_set(Elm_Map_Overlay *overlay, int zoom);
683 * Get the minimum zoom from where the overlay is displayed.
685 * @param overlay The overlay to return the minimum zoom.
686 * @return zoom The minimum zoom.
688 * @see elm_map_overlay_displayed_zoom_min_set()
692 EAPI int elm_map_overlay_displayed_zoom_min_get(const Elm_Map_Overlay *overlay);
695 * Pause or unpause the overlay.
697 * @param overlay The overlay to be paused.
698 * @param paused Use @c EINA_TRUE to pause the @p overlay or @c EINA_FALSE
701 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
704 * The default is off.
706 * This will stop moving the overlay coordinates instantly.
707 * even if map being scrolled or zoomed.
709 * @see elm_map_overlay_paused_get()
713 EAPI void elm_map_overlay_paused_set(Elm_Map_Overlay *overlay, Eina_Bool paused);
716 * Get a value whether the overlay is paused or not.
718 * @param overlay The overlay to return paused state.
719 * @return @c EINA_TRUE means overlay is paused. @c EINA_FALSE indicates
722 * This gets the current paused state for the overlay.
724 * @see elm_map_overlay_paused_set()
728 EAPI Eina_Bool elm_map_overlay_paused_get(const Elm_Map_Overlay *overlay);
731 * Set the content object of the overlay.
733 * @param overlay The overlay to be set the content.
734 * @param obj The evas object will be used to display the overlay.
736 * Only default and class type overlay support this function.
738 * The content should be resized or set size hints before set to the overlay.
739 * <b> Do not modify this object</b> (move, show, hide, del, etc.),
741 * You can only resize this.
743 * This content is what will be inside the overlay that will be displayed.
744 * If a content is set, icon and default style layout are no more used before
745 * the content is deleted.
747 * If @p obj is @c NULL, content inside the overlay is deleted.
749 * @see elm_map_overlay_content_get()
753 EAPI void elm_map_overlay_content_set(Elm_Map_Overlay *overlay, Evas_Object *obj);
756 * Get the content object.
758 * @param overlay The overlay to return the content.
759 * @return Return the evas object if it exists, else @c NULL.
761 * Only default and class type overlay support this function.
763 * Returned content is what being inside the overlay that being displayed.
765 * <b> Do not modify this object</b> (move, show, hide, del, etc.).
766 * You can only resize this.
768 * The content can be set by elm_map_overlay_content_set().
770 * @see elm_map_overlay_content_set()
774 EAPI const Evas_Object * elm_map_overlay_content_get(const Elm_Map_Overlay *overlay);
777 * Set a icon of the overlay.
779 * @param overlay The overlay to be set the icon.
780 * @param icon The icon will be used to display the overlay.
782 * Only default and class type overlay support this function.
784 * <b> Do not modify this object</b> (move, show, hide, resize, del, etc.),
787 * If icon is set, default style layout will not be used.
789 * If @p icon is @c NULL, icon inside the overlay will be deleted.
791 * @see elm_map_overlay_icon_get()
795 EAPI void elm_map_overlay_icon_set(Elm_Map_Overlay *overlay, Evas_Object *icon);
798 * Get the icon object.
800 * @param overlay The overlay to return the icon.
801 * @return Return the icon object if it exists, else @c NULL.
803 * Only default and class type overlay support this function.
805 * Returned icon is what being inside the overlay that being displayed.
807 * <b> Do not modify this icon </b> (move, show, hide, resize, del, etc.).
809 * The icon can be set by elm_map_overlay_icon_set().
811 * @see elm_map_overlay_icon_set()
815 EAPI const Evas_Object * elm_map_overlay_icon_get(const Elm_Map_Overlay *overlay);
818 * Set the geographic coordinates of the overlay.
820 * @param overlay The overlay to be set geographic coordinates.
821 * @param lon Longitude to be set.
822 * @param lat Latitude to be set.
824 * Only default and bubble type overlay support this function.
826 * This sets the center coordinates of the overlay. It can be
827 * get by elm_map_overlay_region_get().
829 * @see elm_map_overlay_region_get()
833 EAPI void elm_map_overlay_region_set(Elm_Map_Overlay *overlay, double lon, double lat);
836 * Get the geographic coordinates of the overlay.
838 * @param overlay The overlay to return geographic coordinates.
839 * @param lon Pointer to store longitude.
840 * @param lat Pointer to store latitude.
842 * Only default and bubble type overlay support this function.
844 * This returns the center coordinates of the overlay. It can be
845 * set by elm_map_overlay_region_set().
847 * @see elm_map_overlay_region_set()
851 EAPI void elm_map_overlay_region_get(const Elm_Map_Overlay *overlay, double *lon, double *lat);
855 * Set the object color of the overlay.
857 * @param overlay The overlay to be set color.
858 * @param r Red channel value, from 0 to 255.
859 * @param g Green channel value, from 0 to 255.
860 * @param b Blue channel value, from 0 to 255.
861 * @param a Alpha channel value, from 0 to 255.
863 * It uses an additive color model, so each color channel represents
864 * how much of each primary colors must to be used. 0 represents
865 * absence of this color, so if all of the three are set to 0,
866 * the color will be black.
868 * These component values should be integers in the range 0 to 255,
869 * (single 8-bit byte).
871 * This sets the color used for the overlay. By default, it is set to
872 * solid red (r = 255, g = 0, b = 0, a = 255).
874 * For alpha channel, 0 represents completely transparent, and 255, opaque.
876 * @see elm_map_overlay_color_get()
880 EAPI void elm_map_overlay_color_set(Elm_Map_Overlay *overlay, int r, int g, int b, int a);
883 * Get the object color of the overlay.
885 * @param overlay The overlay to return color.
886 * @param r Pointer to store the red channel value.
887 * @param g Pointer to store the green channel value.
888 * @param b Pointer to store the blue channel value.
889 * @param a Pointer to store the alpha channel value.
891 * @see elm_map_overlay_color_set()
895 EAPI void elm_map_overlay_color_get(const Elm_Map_Overlay *overlay, int *r, int *g, int *b, int *a);
898 * Show the given overlay at the center of the map, immediately.
900 * @param overlay The overlay to be center at.
902 * This causes map to @b redraw its viewport's contents to the
903 * region containing the given @p overlay's coordinates, that will be
904 * moved to the center of the map.
906 * @see elm_map_overlays_show() if more than one overlay need to be displayed.
910 EAPI void elm_map_overlay_show(Elm_Map_Overlay *overlay);
913 * Move and zoom the map to display a list of overlays.
915 * @param overlays A list of #Elm_Map_Overlay handles.
917 * The map will be centered on the center point of the overlays in the list.
918 * Then the map will be zoomed in order to fit the overlays using the maximum
919 * zoom which allows display of all the overlays.
921 * @warning All the overlays should belong to the same map object.
923 * @see elm_map_overlay_show() to show a single overlay.
927 EAPI void elm_map_overlays_show(Eina_List *overlays);
930 * Set the get callback function of the overlay.
932 * @param overlay The overlay to own the get callback function.
933 * @param get_cb The callback function.
934 * @param data The user callback data.
936 * If the overlay is clicked, the callback wll be called.
937 * The clicked overlay is returned by callback.
938 * You can delete this callback function by setting @c NULL.
942 EAPI void elm_map_overlay_get_cb_set(Elm_Map_Overlay *overlay, Elm_Map_Overlay_Get_Cb get_cb, void *data);
946 * Add a new class overlay to the map object.
947 * This overlay has a class type.
949 * @param obj The map object to add a new overlay.
950 * @return The created overlay or @c NULL upon failure.
952 * This overlay is not shown before overlay members are appended.
953 * if overlay members in the same class are close, group overlays
954 * are created. If they are far away, group overlays are hidden.
955 * When group overlays are shown, they have default style layouts at first.
957 * You can change the state (hidden, paused, etc.) or set the content
958 * or icon of the group overlays by chaning the state of the class overlay.
959 * Do not control the group overlay itself.
961 * Also these changes have a influence on the overlays in the same class
962 * even if each overlay is alone and is not grouped.
964 * @see elm_map_overlay_del()
965 * @see elm_map_overlay_add()
966 * @see elm_map_overlay_bubble_add()
970 EAPI Elm_Map_Overlay * elm_map_overlay_class_add(Evas_Object *obj);
973 * Add a new overlay member to the class overlay.
975 * @param clas The class overlay to add a new overlay.
976 * @param overlay The overlay to be added to the class overlay.
978 * @see elm_map_overlay_class_remove()
982 EAPI void elm_map_overlay_class_append(Elm_Map_Overlay *clas, Elm_Map_Overlay *overlay);
985 * Remove a overlay from the class.
987 * @param clas The class overlay to delete the overlay.
988 * @param overlay The overlay to be deleted from the class overlay.
990 * @see elm_map_overlay_class_append()
994 EAPI void elm_map_overlay_class_remove(Elm_Map_Overlay *clas, Elm_Map_Overlay *overlay);
997 * Set the maximum zoom from where the overlay members in the class can be
1000 * @param clas The overlay class has overlay members.
1001 * @param zoom The maximum zoom.
1003 * Overlay members in the class only will be grouped when the map
1004 * is displayed at less than @p zoom.
1006 * @see elm_map_overlay_class_zoom_max_get()
1010 EAPI void elm_map_overlay_class_zoom_max_set(Elm_Map_Overlay *clas, int zoom);
1013 * Get the maximum zoom from where the overlay members in the class can be
1016 * @param clas The overlay class has overlay members.
1018 * @return The maximum zoom.
1020 * @see elm_map_overlay_class_zoom_max_set()
1024 EAPI int elm_map_overlay_class_zoom_max_get(const Elm_Map_Overlay *clas);
1027 * Add a new bubble overlay to the map object.
1028 * This overlay has a bubble type.
1030 * @param obj The map object to add a new overlay.
1031 * @return The created overlay or @c NULL upon failure.
1033 * A bubble will not be displayed before geographic coordinates are set or
1034 * any other overlays are followed.
1036 * This overlay has a bubble style layout and icon or content can not
1039 * Overlay created with this method can be deleted with elm_map_overlay_del().
1041 * @see elm_map_overlay_del()
1042 * @see elm_map_overlay_add()
1043 * @see elm_map_overlay_class_add()
1044 * @see elm_map_overlay_region_set()
1045 * @see elm_map_overlay_bubble_follow()
1049 EAPI Elm_Map_Overlay * elm_map_overlay_bubble_add(Evas_Object *obj);
1052 * Follow a other overlay.
1054 * @param bubble The bubble overlay to follow a parent overlay.
1055 * @param parent The parent overlay to be followed by the bubble overlay.
1057 * Bubble overlay will follow the parent overlay's movement (hide, show, move).
1059 * @see elm_map_overlay_bubble_add()
1063 EAPI void elm_map_overlay_bubble_follow(Elm_Map_Overlay *bubble, const Elm_Map_Overlay *parent);
1066 * Add a content object to the bubble overlay.
1068 * @param bubble The bubble overlay to add a content.
1069 * @param content The content to be added to the bubble overlay.
1071 * Added contents will be displayed inside the bubble overlay.
1073 * @see elm_map_overlay_bubble_content_clear()
1077 EAPI void elm_map_overlay_bubble_content_append(Elm_Map_Overlay *bubble, Evas_Object *content);
1080 * Clear all contents inside the bubble overlay.
1082 * @param bubble The bubble overlay to clear the contents.
1084 * This will delete all contents inside the bubble overlay.
1086 * @see elm_map_overlay_bubble_content_append()
1090 EAPI void elm_map_overlay_bubble_content_clear(Elm_Map_Overlay *bubble);
1093 * Add a new route overlay to the map object.
1094 * This overlay has a route type.
1096 * @param obj The map object to add a new overlay.
1097 * @param route The route object to make a overlay.
1098 * @return The created overlay or @c NULL upon failure.
1100 * This overlay has a route style layout and icon or content can not
1103 * The color scheme can be changed by elm_map_overlay_content_set().
1105 * Overlay created with this method can be deleted with elm_map_overlay_del().
1107 * @see elm_map_overlay_del()
1108 * @see elm_map_overlay_class_add()
1109 * @see elm_map_overlay_content_set()
1110 * @see elm_map_overlay_content_get()
1114 EAPI Elm_Map_Overlay * elm_map_overlay_route_add(Evas_Object *obj, const Elm_Map_Route *route);
1117 * Get the information of tile load status.
1119 * @param obj The map object.
1120 * @param try_num Pointer to store number of tiles download requested.
1121 * @param finish_num Pointer to store number of tiles successfully downloaded.
1123 * This gets the current tile loaded status for the map object.
1127 EAPI void elm_map_tile_load_status_get(const Evas_Object *obj, int *try_num, int *finish_num);
1130 * Get the names of available sources for a specific type.
1132 * @param obj The map object.
1133 * @param type source type.
1134 * @return The char pointer array of source names.
1136 * It will provide a list with all available sources.
1137 * Current source can be set by elm_map_source_set(), or get with
1138 * elm_map_source_get().
1140 * At least available sources of tile type:
1146 * At least available sources of route type:
1149 * At least available sources of name type:
1152 * @see elm_map_source_set()
1153 * @see elm_map_source_get()
1157 EAPI const char **elm_map_sources_get(const Evas_Object *obj, Elm_Map_Source_Type type);
1160 * Set the current source of the map for a specific type.
1162 * @param obj The map object.
1163 * @param type source type.
1164 * @param source_name The source to be used.
1166 * Map widget retrieves tile images that composes the map from a web service.
1167 * This web service can be set with this method
1168 * for ELM_MAP_SOURCE_TYPE_TILE type.
1169 * A different service can return a different maps with different
1170 * information and it can use different zoom values.
1172 * Map widget provides route data based on a external web service.
1173 * This web service can be set with this method
1174 * for ELM_MAP_SOURCE_TYPE_ROUTE type.
1176 * Map widget also provide geoname data based on a external web service.
1177 * This web service can be set with this method
1178 * for ELM_MAP_SOURCE_TYPE_NAME type.
1180 * The @p source_name need to match one of the names provided by
1181 * elm_map_sources_get().
1183 * The current source can be get using elm_map_source_get().
1185 * @see elm_map_sources_get()
1186 * @see elm_map_source_get()
1190 EAPI void elm_map_source_set(Evas_Object *obj, Elm_Map_Source_Type type, const char *source_name);
1193 * Get the name of currently used source for a specific type.
1195 * @param obj The map object.
1196 * @param type source type.
1197 * @return Returns the name of the source in use.
1199 * @see elm_map_sources_get()
1200 * @see elm_map_source_set()
1204 EAPI const char *elm_map_source_get(const Evas_Object *obj, Elm_Map_Source_Type type);
1207 * Add a new route to the map object.
1209 * @param obj The map object.
1210 * @param type The type of transport to be considered when tracing a route.
1211 * @param method The routing method, what should be prioritized.
1212 * @param flon The start longitude.
1213 * @param flat The start latitude.
1214 * @param tlon The destination longitude.
1215 * @param tlat The destination latitude.
1217 * @return The created route or @c NULL upon failure.
1219 * A route will be traced by point on coordinates (@p flat, @p flon)
1220 * to point on coordinates (@p tlat, @p tlon), using the route service
1221 * set with elm_map_source_set().
1223 * It will take @p type on consideration to define the route,
1224 * depending if the user will be walking or driving, the route may vary.
1225 * One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or
1226 * #ELM_MAP_ROUTE_TYPE_FOOT need to be used.
1228 * Another parameter is what the route should prioritize, the minor distance
1229 * or the less time to be spend on the route. So @p method should be one
1230 * of #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST.
1232 * Routes created with this method can be deleted with
1233 * elm_map_route_remove(),
1234 * and distance can be get with elm_map_route_distance_get().
1236 * @see elm_map_route_remove()
1237 * @see elm_map_route_distance_get()
1238 * @see elm_map_source_set()
1242 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, Elm_Map_Route_Cb route_cb, void *data);
1245 * Remove a route from the map.
1247 * @param route The route to remove.
1249 * @see elm_map_route_add()
1253 EAPI void elm_map_route_del(Elm_Map_Route *route);
1256 * Get the route distance in kilometers.
1258 * @param route The route object.
1259 * @return The distance of route (unit : km).
1263 EAPI double elm_map_route_distance_get(const Elm_Map_Route *route);
1266 * Get the information of route nodes.
1268 * @param route The route object.
1269 * @return Returns a string with the nodes of route.
1273 EAPI const char *elm_map_route_node_get(const Elm_Map_Route *route);
1276 * Get the information of route waypoint.
1278 * @param route the route object.
1279 * @return Returns a string with information about waypoint of route.
1283 EAPI const char *elm_map_route_waypoint_get(const Elm_Map_Route *route);
1286 * Request a address or geographic coordinates(longitude, latitude)
1287 * from a given address or geographic coordinate(longitude, latitude).
1289 * @param obj The map object.
1290 * @param address The address.
1291 * @param lon The longitude.
1292 * @param lat The latitude.
1293 * @param name_cb The callback function.
1294 * @param data The user callback data.
1295 * @return name A #Elm_Map_Name handle for this coordinate.
1297 * If you want to get address from geographic coordinates, set input @p address
1298 * as NULL and set @p lon, @p lat as you want to convert.
1299 * If address is set except NULL, @p lon and @p lat are checked.
1301 * To get the string for this address, elm_map_name_address_get()
1302 * should be used after callback or "name,loaded" signal is called.
1304 * To get the longitude and latitude, elm_map_name_region_get()
1309 EAPI Elm_Map_Name *elm_map_name_add(const Evas_Object *obj, const char *address, double lon, double lat, Elm_Map_Name_Cb name_cb, void *data);
1312 * Get the address of the name.
1314 * @param name The name handle.
1315 * @return Returns the address string of @p name.
1317 * This gets the coordinates of the @p name, created with one of the
1318 * conversion functions.
1320 * @see elm_map_name_add()
1324 EAPI const char *elm_map_name_address_get(const Elm_Map_Name *name);
1327 * Get the current coordinates of the name.
1329 * @param name The name handle.
1330 * @param lat Pointer to store the latitude.
1331 * @param lon Pointer to store The longitude.
1333 * This gets the coordinates of the @p name, created with one of the
1334 * conversion functions.
1336 * @see elm_map_name_add()
1340 EAPI void elm_map_name_region_get(const Elm_Map_Name *name, double *lon, double *lat);
1343 * Remove a name from the map.
1345 * @param name The name to remove.
1347 * Basically the struct handled by @p name will be freed, so conversions
1348 * between address and coordinates will be lost.
1350 * @see elm_map_name_add()
1354 EAPI void elm_map_name_del(Elm_Map_Name *name);
1357 * Add a track on the map
1359 * @param obj The map object.
1360 * @param emap The emap route object.
1361 * @return The route object. This is an elm object of type Route.
1363 * @see elm_route_add() for details.
1367 EAPI Evas_Object *elm_map_track_add(Evas_Object *obj, void *emap);
1370 * Remove a track from the map
1372 * @param obj The map object.
1373 * @param route The track to remove.
1377 EAPI void elm_map_track_remove(Evas_Object *obj, Evas_Object *route);