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_GROUP,
169 ELM_MAP_OVERLAY_TYPE_BUBBLE,
170 ELM_MAP_OVERLAY_TYPE_ROUTE,
171 ELM_MAP_OVERLAY_TYPE_LINE,
172 ELM_MAP_OVERLAY_TYPE_POLYGON,
173 ELM_MAP_OVERLAY_TYPE_CIRCLE,
174 ELM_MAP_OVERLAY_TYPE_SCALE
176 } Elm_Map_Overlay_Type;
178 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(). */
179 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(). */
180 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(). */
181 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(). */
182 typedef struct _Elm_Map_Name Elm_Map_Name; /**< A handle for specific coordinates. */
183 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(). */
185 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. */
186 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. */
187 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. */
188 typedef Evas_Object *(*Elm_Map_Group_Icon_Get_Func)(Evas_Object *obj, void *data); /**< Icon fetching class function for markers group classes. */
190 typedef void (*Elm_Map_Overlay_Get_Cb)(void *data, Evas_Object *map, Elm_Map_Overlay *overlay); /**< Get callback function for the overlay. */
191 typedef void (*Elm_Map_Name_Cb)(void *data, Evas_Object *map, Elm_Map_Name *name); /**< Async-callback function for the name request. */
192 typedef void (*Elm_Map_Route_Cb)(void *data, Evas_Object *map, Elm_Map_Route *route); /**< Async-callback function for the route request. */
195 * Add a new map widget to the given parent Elementary (container) object.
197 * @param parent The parent object.
198 * @return a new map widget handle or @c NULL, on errors.
200 * This function inserts a new map widget on the canvas.
204 EAPI Evas_Object *elm_map_add(Evas_Object *parent);
207 * Set the zoom level of the map.
209 * @param obj The map object.
210 * @param zoom The zoom level to set.
212 * This sets the zoom level.
214 * It will respect limits defined by elm_map_zoom_min_set() and
215 * elm_map_zoom_max_set().
217 * By default these values are 0 (world map) and 18 (maximum zoom).
219 * This function should be used when zoom mode is set to
220 * #ELM_MAP_ZOOM_MODE_MANUAL. This is the default mode, and can be set
221 * with elm_map_zoom_mode_set().
223 * @see elm_map_zoom_mode_set()
224 * @see elm_map_zoom_get()
228 EAPI void elm_map_zoom_set(Evas_Object *obj, int zoom);
231 * Get the zoom level of the map.
233 * @param obj The map object.
234 * @return The current zoom level.
236 * This returns the current zoom level of the map object.
238 * Note that if you set the fill mode to other than #ELM_MAP_ZOOM_MODE_MANUAL
239 * (which is the default), the zoom level may be changed at any time by the
240 * map object itself to account for map size and map viewport size.
242 * @see elm_map_zoom_set() for details.
246 EAPI int elm_map_zoom_get(const Evas_Object *obj);
249 * Set the zoom mode used by the map object.
251 * @param obj The map object.
252 * @param mode The zoom mode of the map, being it one of
253 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
254 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
256 * This sets the zoom mode to manual or one of the automatic levels.
257 * Manual (#ELM_MAP_ZOOM_MODE_MANUAL) means that zoom is set manually by
258 * elm_map_zoom_set() and will stay at that level until changed by code
259 * or until zoom mode is changed. This is the default mode.
261 * The Automatic modes will allow the map object to automatically
262 * adjust zoom mode based on properties. #ELM_MAP_ZOOM_MODE_AUTO_FIT will
263 * adjust zoom so the map fits inside the scroll frame with no pixels
264 * outside this area. #ELM_MAP_ZOOM_MODE_AUTO_FILL will be similar but
265 * ensure no pixels within the frame are left unfilled. Do not forget that
266 * the valid sizes are 2^zoom, consequently the map may be smaller than
269 * @see elm_map_zoom_set()
273 EAPI void elm_map_zoom_mode_set(Evas_Object *obj, Elm_Map_Zoom_Mode mode);
276 * Get the zoom mode used by the map object.
278 * @param obj The map object.
279 * @return The zoom mode of the map, being it one of
280 * #ELM_MAP_ZOOM_MODE_MANUAL (default), #ELM_MAP_ZOOM_MODE_AUTO_FIT,
281 * or #ELM_MAP_ZOOM_MODE_AUTO_FILL.
283 * This function returns the current zoom mode used by the map object.
285 * @see elm_map_zoom_mode_set() for more details.
289 EAPI Elm_Map_Zoom_Mode elm_map_zoom_mode_get(const Evas_Object *obj);
292 * Set the minimum zoom of the source.
294 * @param obj The map object.
295 * @param zoom New minimum zoom value to be used.
297 * @see elm_map_zoom_min_get() for details.
301 EAPI void elm_map_zoom_min_set(Evas_Object *obj, int zoom);
304 * Get the minimum zoom of the source.
306 * @param obj The map object.
307 * @return Returns the minimum zoom of the source.
309 * @see elm_map_zoom_min_set() for details.
313 EAPI int elm_map_zoom_min_get(const Evas_Object *obj);
316 * Set the maximum zoom of the source.
318 * @param obj The map object.
319 * @param zoom New maximum zoom value to be used.
321 * @see elm_map_zoom_max_get() for details.
325 EAPI void elm_map_zoom_max_set(Evas_Object *obj, int zoom);
328 * Get the maximum zoom of the source.
330 * @param obj The map object.
331 * @return Returns the maximum zoom of the source.
333 * @see elm_map_zoom_max_set() for details.
337 EAPI int elm_map_zoom_max_get(const Evas_Object *obj);
340 * Get the current geographic coordinates of the map.
342 * @param obj The map object.
343 * @param lon Pointer to store longitude.
344 * @param lat Pointer to store latitude.
346 * This gets the current center coordinates of the map object. It can be
347 * set by elm_map_region_bring_in() and elm_map_region_show().
349 * @see elm_map_region_bring_in()
350 * @see elm_map_region_show()
354 EAPI void elm_map_region_get(const Evas_Object *obj, double *lon, double *lat);
357 * Animatedly bring in given coordinates to the center of the map.
359 * @param obj The map object.
360 * @param lon Longitude to center at.
361 * @param lat Latitude to center at.
363 * This causes map to jump to the given @p lat and @p lon coordinates
364 * and show it (by scrolling) in the center of the viewport, if it is not
365 * already centered. This will use animation to do so and take a period
366 * of time to complete.
368 * @see elm_map_region_show() for a function to avoid animation.
369 * @see elm_map_region_get()
373 EAPI void elm_map_region_bring_in(Evas_Object *obj, double lon, double lat);
376 * Show the given coordinates at the center of the map, @b immediately.
378 * @param obj The map object.
379 * @param lon Longitude to center at.
380 * @param lat Latitude to center at.
382 * This causes map to @b redraw its viewport's contents to the
383 * region containing the given @p lat and @p lon, that will be moved to the
386 * @see elm_map_region_bring_in() for a function to move with animation.
387 * @see elm_map_region_get()
391 EAPI void elm_map_region_show(Evas_Object *obj, double lon, double lat);
394 * Convert canvas coordinates into geographic coordinates
395 * (longitude, latitude).
397 * @param obj The map object.
398 * @param x horizontal coordinate of the point to convert.
399 * @param y vertical coordinate of the point to convert.
400 * @param lon A pointer to the longitude.
401 * @param lat A pointer to the latitude.
403 * This gets longitude and latitude from canvas x, y coordinates. The canvas
404 * coordinates mean x, y coordinate from current viewport.
406 * see elm_map_region_to_canvas_convert()
410 EAPI void elm_map_canvas_to_region_convert(const Evas_Object *obj, const Evas_Coord x, const Evas_Coord y, double *lon, double *lat);
413 * Convert geographic coordinates (longitude, latitude)
414 * into canvas coordinates.
416 * @param obj The map object.
417 * @param lon The longitude to convert.
418 * @param lat The latitude to convert.
419 * @param x A pointer to horizontal coordinate.
420 * @param y A pointer to vertical coordinate.
422 * This gets canvas x, y coordinates from longitude and latitude. The canvas
423 * coordinates mean x, y coordinate from current viewport.
425 * see elm_map_canvas_to_region_convert()
429 EAPI void elm_map_region_to_canvas_convert(const Evas_Object *obj, double lon, double lat, Evas_Coord *x, Evas_Coord *y);
432 * Pause or unpause the map.
434 * @param obj The map object.
435 * @param paused Use @c EINA_TRUE to pause the map @p obj or @c EINA_FALSE
438 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
441 * The default is off.
443 * This will stop zooming using animation, changing zoom levels will
444 * change instantly. This will stop any existing animations that are running.
446 * @see elm_map_paused_get()
450 EAPI void elm_map_paused_set(Evas_Object *obj, Eina_Bool paused);
453 * Get a value whether map is paused or not.
455 * @param obj The map object.
456 * @return @c EINA_TRUE means map is pause. @c EINA_FALSE indicates
459 * This gets the current paused state for the map object.
461 * @see elm_map_paused_set() for details.
465 EAPI Eina_Bool elm_map_paused_get(const Evas_Object *obj);
470 * @param obj The map object.
471 * @param degree Angle from 0.0 to 360.0 to rotate around Z axis.
472 * @param cx Rotation's center horizontal position.
473 * @param cy Rotation's center vertical position.
475 * @see elm_map_rotate_get()
479 EAPI void elm_map_rotate_set(Evas_Object *obj, double degree, Evas_Coord cx, Evas_Coord cy);
482 * Get the rotate degree of the map
484 * @param obj The map object
485 * @param degree Pointer to store degrees from 0.0 to 360.0
486 * to rotate around Z axis.
487 * @param cx Pointer to store rotation's center horizontal position.
488 * @param cy Pointer to store rotation's center vertical position.
490 * @see elm_map_rotate_set() to set map rotation.
494 EAPI void elm_map_rotate_get(const Evas_Object *obj, double *degree, Evas_Coord *cx, Evas_Coord *cy);
497 * Enable or disable mouse wheel to be used to zoom in / out the map.
499 * @param obj The map object.
500 * @param disabled Use @c EINA_TRUE to disable mouse wheel or @c EINA_FALSE
503 * Mouse wheel can be used for the user to zoom in or zoom out the map.
505 * It's disabled by default.
507 * @see elm_map_wheel_disabled_get()
511 EAPI void elm_map_wheel_disabled_set(Evas_Object *obj, Eina_Bool disabled);
514 * Get a value whether mouse wheel is enabled or not.
516 * @param obj The map object.
517 * @return @c EINA_TRUE means map is disabled. @c EINA_FALSE indicates
520 * Mouse wheel can be used for the user to zoom in or zoom out the map.
522 * @see elm_map_wheel_disabled_set() for details.
526 EAPI Eina_Bool elm_map_wheel_disabled_get(const Evas_Object *obj);
529 * Set the user agent used by the map object to access routing services.
531 * @param obj The map object.
532 * @param user_agent The user agent to be used by the map.
534 * User agent is a client application implementing a network protocol used
535 * in communications within a client–server distributed computing system
537 * The @p user_agent identification string will transmitted in a header
538 * field @c User-Agent.
540 * @see elm_map_user_agent_get()
544 EAPI void elm_map_user_agent_set(Evas_Object *obj, const char *user_agent);
547 * Get the user agent used by the map object.
549 * @param obj The map object.
550 * @return The user agent identification string used by the map.
552 * @see elm_map_user_agent_set() for details.
556 EAPI const char *elm_map_user_agent_get(const Evas_Object *obj);
560 * Add a new overlay to the map object. This overlay has a default type.
562 * @param obj The map object to add a new overlay.
563 * @param lon The longitude of the overlay.
564 * @param lat The latitude of the overlay.
565 * @return The created overlay or @c NULL upon failure.
567 * A overlay will be created and shown in a specific point of the map, defined
568 * by @p lon and @p lat.
570 * The created overlay has a default style layout before content or
572 * If content or icon is set, those are displayed instead of default style
574 * You can set by using elm_map_overlay_content_set() or
575 * elm_map_overlay_icon_set(). If NULL is set, default style
578 * Overlay created with this method can be deleted by elm_map_overlay_del().
580 * @see elm_map_overlay_del()
581 * @see elm_map_overlay_class_add()
582 * @see elm_map_overlay_bubble_add()
583 * @see elm_map_overlay_content_set()
584 * @see elm_map_overlay_icon_set()
588 EAPI Elm_Map_Overlay * elm_map_overlay_add(Evas_Object *obj, double lon, double lat);
591 * Delete a overlay from the map. This function can delete all types
594 * @param overlay The overlay to be deleted.
596 * @see elm_map_overlay_add()
597 * @see elm_map_overlay_class_add()
598 * @see elm_map_overlay_bubble_add()
602 EAPI void elm_map_overlay_del(Elm_Map_Overlay *overlay);
605 * Get the overlay type.
607 * @param overlay The overlay to return type.
608 * @return Return the overlay type.
610 * This type is resolved when the overlay is created.
612 * @see elm_map_overlay_add()
613 * @see elm_map_overlay_class_add()
614 * @see elm_map_overlay_bubble_add()
618 EAPI Elm_Map_Overlay_Type elm_map_overlay_type_get(const Elm_Map_Overlay *overlay);
621 * Set a pointer of user data for a overlay.
623 * @param overlay The overlay to own the user data.
624 * @param data A pointer of user data
626 * @see elm_map_overlay_data_get()
630 EAPI void elm_map_overlay_data_set(Elm_Map_Overlay *overlay, void *data);
633 * Get the user data stored on a overlay.
635 * @param overlay The overlay to return the user data.
636 * @return A pointer to data stored using elm_map_overlay_data_set(),
637 * or @c NULL, if none has been set.
639 * @see elm_map_overlay_data_set()
643 EAPI void * elm_map_overlay_data_get(const Elm_Map_Overlay *overlay);
646 * Set if the overlay is hidden or not.
648 * @param overlay The overlay to be hidden.
649 * @param hide Use @c EINA_TRUE to hide the overlay or @c EINA_FALSE to show.
651 * @see elm_map_overlay_hide_get()
655 EAPI void elm_map_overlay_hide_set(Elm_Map_Overlay *overlay, Eina_Bool hide);
658 * Get a value whether the overlay is hidden or not.
660 * @param overlay The overlay to return the hidden state.
661 * @return @c EINA_TRUE means the overlay is hidden. @c EINA_FALSE indicates
664 * This gets the current hidden state for the overlay.
666 * @see elm_map_overlay_hide_set()
670 EAPI Eina_Bool elm_map_overlay_hide_get(const Elm_Map_Overlay *overlay);
673 * Set the minimum zoom from where the overlay is displayed.
675 * @param overlay The overlay to be set the minimum zoom.
676 * @param zoom The minimum zoom.
678 * The overlay only will be displayed when the map is displayed at @p zoom
681 * @see elm_map_overlay_displayed_zoom_min_get()
685 EAPI void elm_map_overlay_displayed_zoom_min_set(Elm_Map_Overlay *overlay, int zoom);
688 * Get the minimum zoom from where the overlay is displayed.
690 * @param overlay The overlay to return the minimum zoom.
691 * @return zoom The minimum zoom.
693 * @see elm_map_overlay_displayed_zoom_min_set()
697 EAPI int elm_map_overlay_displayed_zoom_min_get(const Elm_Map_Overlay *overlay);
700 * Pause or unpause the overlay.
702 * @param overlay The overlay to be paused.
703 * @param paused Use @c EINA_TRUE to pause the @p overlay or @c EINA_FALSE
706 * This sets the paused state to on (@c EINA_TRUE) or off (@c EINA_FALSE)
709 * The default is off.
711 * This will stop moving the overlay coordinates instantly.
712 * even if map being scrolled or zoomed.
714 * @see elm_map_overlay_paused_get()
718 EAPI void elm_map_overlay_paused_set(Elm_Map_Overlay *overlay, Eina_Bool paused);
721 * Get a value whether the overlay is paused or not.
723 * @param overlay The overlay to return paused state.
724 * @return @c EINA_TRUE means overlay is paused. @c EINA_FALSE indicates
727 * This gets the current paused state for the overlay.
729 * @see elm_map_overlay_paused_set()
733 EAPI Eina_Bool elm_map_overlay_paused_get(const Elm_Map_Overlay *overlay);
736 * Set the content object of the overlay.
738 * @param overlay The overlay to be set the content.
739 * @param obj The evas object will be used to display the overlay.
741 * Only default and class type overlay support this function.
743 * The content should be resized or set size hints before set to the overlay.
744 * <b> Do not modify this object</b> (move, show, hide, del, etc.),
746 * You can only resize this.
748 * This content is what will be inside the overlay that will be displayed.
749 * If a content is set, icon and default style layout are no more used before
750 * the content is deleted.
752 * If @p obj is @c NULL, content inside the overlay is deleted.
754 * @see elm_map_overlay_content_get()
758 EAPI void elm_map_overlay_content_set(Elm_Map_Overlay *overlay, Evas_Object *obj);
761 * Get the content object.
763 * @param overlay The overlay to return the content.
764 * @return Return the evas object if it exists, else @c NULL.
766 * Only default and class type overlay support this function.
768 * Returned content is what being inside the overlay that being displayed.
770 * <b> Do not modify this object</b> (move, show, hide, del, etc.).
771 * You can only resize this.
773 * The content can be set by elm_map_overlay_content_set().
775 * @see elm_map_overlay_content_set()
779 EAPI const Evas_Object * elm_map_overlay_content_get(const Elm_Map_Overlay *overlay);
782 * Set a icon of the overlay.
784 * @param overlay The overlay to be set the icon.
785 * @param icon The icon will be used to display the overlay.
787 * Only default and class type overlay support this function.
789 * <b> Do not modify this object</b> (move, show, hide, resize, del, etc.),
792 * If icon is set, default style layout will not be used.
794 * If @p icon is @c NULL, icon inside the overlay will be deleted.
796 * @see elm_map_overlay_icon_get()
800 EAPI void elm_map_overlay_icon_set(Elm_Map_Overlay *overlay, Evas_Object *icon);
803 * Get the icon object.
805 * @param overlay The overlay to return the icon.
806 * @return Return the icon object if it exists, else @c NULL.
808 * Only default and class type overlay support this function.
810 * Returned icon is what being inside the overlay that being displayed.
812 * <b> Do not modify this icon </b> (move, show, hide, resize, del, etc.).
814 * The icon can be set by elm_map_overlay_icon_set().
816 * @see elm_map_overlay_icon_set()
820 EAPI const Evas_Object * elm_map_overlay_icon_get(const Elm_Map_Overlay *overlay);
823 * Set the geographic coordinates of the overlay.
825 * @param overlay The overlay to be set geographic coordinates.
826 * @param lon Longitude to be set.
827 * @param lat Latitude to be set.
829 * Only default and bubble type overlay support this function.
831 * This sets the center coordinates of the overlay. It can be
832 * get by elm_map_overlay_region_get().
834 * @see elm_map_overlay_region_get()
838 EAPI void elm_map_overlay_region_set(Elm_Map_Overlay *overlay, double lon, double lat);
841 * Get the geographic coordinates of the overlay.
843 * @param overlay The overlay to return geographic coordinates.
844 * @param lon Pointer to store longitude.
845 * @param lat Pointer to store latitude.
847 * Only default and bubble type overlay support this function.
849 * This returns the center coordinates of the overlay. It can be
850 * set by elm_map_overlay_region_set().
852 * @see elm_map_overlay_region_set()
856 EAPI void elm_map_overlay_region_get(const Elm_Map_Overlay *overlay, double *lon, double *lat);
860 * Set the object color of the overlay.
862 * @param overlay The overlay to be set color.
863 * @param r Red channel value, from 0 to 255.
864 * @param g Green channel value, from 0 to 255.
865 * @param b Blue channel value, from 0 to 255.
866 * @param a Alpha channel value, from 0 to 255.
868 * It uses an additive color model, so each color channel represents
869 * how much of each primary colors must to be used. 0 represents
870 * absence of this color, so if all of the three are set to 0,
871 * the color will be black.
873 * These component values should be integers in the range 0 to 255,
874 * (single 8-bit byte).
876 * This sets the color used for the overlay. By default, it is set to
877 * solid red (r = 255, g = 0, b = 0, a = 255).
879 * For alpha channel, 0 represents completely transparent, and 255, opaque.
881 * @see elm_map_overlay_color_get()
885 EAPI void elm_map_overlay_color_set(Elm_Map_Overlay *overlay, int r, int g, int b, int a);
888 * Get the object color of the overlay.
890 * @param overlay The overlay to return color.
891 * @param r Pointer to store the red channel value.
892 * @param g Pointer to store the green channel value.
893 * @param b Pointer to store the blue channel value.
894 * @param a Pointer to store the alpha channel value.
896 * @see elm_map_overlay_color_set()
900 EAPI void elm_map_overlay_color_get(const Elm_Map_Overlay *overlay, int *r, int *g, int *b, int *a);
903 * Show the given overlay at the center of the map, immediately.
905 * @param overlay The overlay to be center at.
907 * This causes map to @b redraw its viewport's contents to the
908 * region containing the given @p overlay's coordinates, that will be
909 * moved to the center of the map.
911 * @see elm_map_overlays_show() if more than one overlay need to be displayed.
915 EAPI void elm_map_overlay_show(Elm_Map_Overlay *overlay);
918 * Move and zoom the map to display a list of overlays.
920 * @param overlays A list of #Elm_Map_Overlay handles.
922 * The map will be centered on the center point of the overlays in the list.
923 * Then the map will be zoomed in order to fit the overlays using the maximum
924 * zoom which allows display of all the overlays.
926 * @warning All the overlays should belong to the same map object.
928 * @see elm_map_overlay_show() to show a single overlay.
932 EAPI void elm_map_overlays_show(Eina_List *overlays);
935 * Set the get callback function of the overlay.
937 * @param overlay The overlay to own the get callback function.
938 * @param get_cb The callback function.
939 * @param data The user callback data.
941 * If the overlay is clicked, the callback wll be called.
942 * The clicked overlay is returned by callback.
944 * You can add callback to the class overlay. If one of the group overlays in this class
945 * is clicked, callback will be called and return a virtual group overlays.
947 * You can delete this callback function by setting @c NULL.
951 EAPI void elm_map_overlay_get_cb_set(Elm_Map_Overlay *overlay, Elm_Map_Overlay_Get_Cb get_cb, void *data);
955 * Add a new class overlay to the map object.
956 * This overlay has a class type.
958 * @param obj The map object to add a new overlay.
959 * @return The created overlay or @c NULL upon failure.
961 * This overlay is not shown before overlay members are appended.
962 * if overlay members in the same class are close, group overlays
963 * are created. If they are far away, group overlays are hidden.
964 * When group overlays are shown, they have default style layouts at first.
966 * You can change the state (hidden, paused, etc.) or set the content
967 * or icon of the group overlays by chaning the state of the class overlay.
968 * Do not modifty the group overlay itself.
970 * Also these changes have a influence on the overlays in the same class
971 * even if each overlay is alone and is not grouped.
973 * @see elm_map_overlay_del()
974 * @see elm_map_overlay_add()
975 * @see elm_map_overlay_bubble_add()
979 EAPI Elm_Map_Overlay * elm_map_overlay_class_add(Evas_Object *obj);
982 * Add a new overlay member to the class overlay.
984 * @param clas The class overlay to add a new overlay.
985 * @param overlay The overlay to be added to the class overlay.
987 * @see elm_map_overlay_class_remove()
991 EAPI void elm_map_overlay_class_append(Elm_Map_Overlay *clas, Elm_Map_Overlay *overlay);
994 * Remove a overlay from the class.
996 * @param clas The class overlay to delete the overlay.
997 * @param overlay The overlay to be deleted from the class overlay.
999 * @see elm_map_overlay_class_append()
1003 EAPI void elm_map_overlay_class_remove(Elm_Map_Overlay *clas, Elm_Map_Overlay *overlay);
1006 * Set the maximum zoom from where the overlay members in the class can be
1009 * @param clas The overlay class has overlay members.
1010 * @param zoom The maximum zoom.
1012 * Overlay members in the class only will be grouped when the map
1013 * is displayed at less than @p zoom.
1015 * @see elm_map_overlay_class_zoom_max_get()
1019 EAPI void elm_map_overlay_class_zoom_max_set(Elm_Map_Overlay *clas, int zoom);
1022 * Get the maximum zoom from where the overlay members in the class can be
1025 * @param clas The overlay class has overlay members.
1027 * @return The maximum zoom.
1029 * @see elm_map_overlay_class_zoom_max_set()
1033 EAPI int elm_map_overlay_class_zoom_max_get(const Elm_Map_Overlay *clas);
1036 * Get the overlay members of the group overlay.
1038 * @param grp The group overlay has overlay members.
1040 * @return The list of group overlay members.
1042 * The group overlays are virtualy overlays. Those are shown and hidden dynamically.
1043 * You can add callback to the class overlay. If one of the group overlays in this class
1044 * is clicked, callback will be called and return a virtual group overlays.
1046 * You can change the state (hidden, paused, etc.) or set the content
1047 * or icon of the group overlays by chaning the state of the class overlay.
1048 * Do not modifty the group overlay itself.
1050 * @see elm_map_overlay_class_add()
1054 EAPI Eina_List * elm_map_overlay_group_members_get(const Elm_Map_Overlay *grp);
1057 * Add a new bubble overlay to the map object.
1058 * This overlay has a bubble type.
1060 * @param obj The map object to add a new overlay.
1061 * @return The created overlay or @c NULL upon failure.
1063 * A bubble will not be displayed before geographic coordinates are set or
1064 * any other overlays are followed.
1066 * This overlay has a bubble style layout and icon or content can not
1069 * Overlay created with this method can be deleted with elm_map_overlay_del().
1071 * @see elm_map_overlay_del()
1072 * @see elm_map_overlay_add()
1073 * @see elm_map_overlay_class_add()
1074 * @see elm_map_overlay_region_set()
1075 * @see elm_map_overlay_bubble_follow()
1079 EAPI Elm_Map_Overlay * elm_map_overlay_bubble_add(Evas_Object *obj);
1082 * Follow a other overlay.
1084 * @param bubble The bubble overlay to follow a parent overlay.
1085 * @param parent The parent overlay to be followed by the bubble overlay.
1087 * Bubble overlay will follow the parent overlay's movement (hide, show, move).
1089 * @see elm_map_overlay_bubble_add()
1093 EAPI void elm_map_overlay_bubble_follow(Elm_Map_Overlay *bubble, const Elm_Map_Overlay *parent);
1096 * Add a content object to the bubble overlay.
1098 * @param bubble The bubble overlay to add a content.
1099 * @param content The content to be added to the bubble overlay.
1101 * Added contents will be displayed inside the bubble overlay.
1103 * @see elm_map_overlay_bubble_content_clear()
1107 EAPI void elm_map_overlay_bubble_content_append(Elm_Map_Overlay *bubble, Evas_Object *content);
1110 * Clear all contents inside the bubble overlay.
1112 * @param bubble The bubble overlay to clear the contents.
1114 * This will delete all contents inside the bubble overlay.
1116 * @see elm_map_overlay_bubble_content_append()
1120 EAPI void elm_map_overlay_bubble_content_clear(Elm_Map_Overlay *bubble);
1123 * Add a new route overlay to the map object.
1124 * This overlay has a route type.
1126 * @param obj The map object to add a new overlay.
1127 * @param route The route object to make a overlay.
1128 * @return The created overlay or @c NULL upon failure.
1130 * This overlay has a route style layout and icon or content can not
1133 * The color scheme can be changed by elm_map_overlay_content_set().
1135 * Overlay created with this method can be deleted with elm_map_overlay_del().
1137 * @see elm_map_overlay_del()
1138 * @see elm_map_overlay_class_add()
1139 * @see elm_map_overlay_content_set()
1140 * @see elm_map_overlay_content_get()
1144 EAPI Elm_Map_Overlay * elm_map_overlay_route_add(Evas_Object *obj, const Elm_Map_Route *route);
1147 * Add a new line overlay to the map object.
1148 * This overlay has a line type.
1150 * @param obj The map object to add a new overlay.
1151 * @param flon The start longitude.
1152 * @param flat The start latitude.
1153 * @param tlon The destination longitude.
1154 * @param tlat The destination latitude.
1155 * @return The created overlay or @c NULL upon failure.
1157 * Overlay created with this method can be deleted with elm_map_overlay_del().
1159 * @see elm_map_overlay_del()
1163 EAPI Elm_Map_Overlay * elm_map_overlay_line_add(Evas_Object *obj, double flon, double flat, double tlon, double tlat);
1166 * Add a new polygon overlay to the map object.
1167 * This overlay has a polygon type.
1169 * @param obj The map object to add a new overlay.
1170 * @return The created overlay or @c NULL upon failure.
1172 * At least 3 regions should be added to show the polygon overlay.
1174 * Overlay created with this method can be deleted with elm_map_overlay_del().
1176 * @see elm_map_overlay_polygon_region_add()
1177 * @see elm_map_overlay_del()
1181 EAPI Elm_Map_Overlay * elm_map_overlay_polygon_add(Evas_Object *obj);
1184 * Add a geographic coordinates to the polygon overlay.
1186 * @param overlay The polygon overlay to get a region.
1187 * @param lon The longitude.
1188 * @param lat The latitude.
1190 * At least 3 regions should be added to show the polygon overlay.
1192 * Overlay created with this method can be deleted with elm_map_overlay_del().
1194 * @see elm_map_overlay_polygon_add()
1195 * @see elm_map_overlay_del()
1199 EAPI void elm_map_overlay_polygon_region_add(Elm_Map_Overlay *overlay, double lon, double lat);
1202 * Add a new circle overlay to the map object.
1203 * This overlay has a circle type.
1205 * @param obj The map object to add a new overlay.
1206 * @param lon The center longitude.
1207 * @param lat The center latitude.
1208 * @param radius The pixel length of radius.
1209 * @return The created overlay or @c NULL upon failure.
1211 * Overlay created with this method can be deleted with elm_map_overlay_del().
1213 * @see elm_map_overlay_del()
1217 EAPI Elm_Map_Overlay * elm_map_overlay_circle_add(Evas_Object *obj, double lon, double lat, double radius);
1220 * Add a new scale overlay to the map object.
1221 * This overlay has a scale type.
1223 * @param obj The map object to add a new overlay.
1224 * @param x horizontal pixel coordinate.
1225 * @param y vertical pixel coordinate
1226 * @return The created overlay or @c NULL upon failure.
1228 * The scale overlay shows the ratio of a distance on the map to the corresponding distance.
1230 * Overlay created with this method can be deleted with elm_map_overlay_del().
1232 * @see elm_map_overlay_del()
1236 EAPI Elm_Map_Overlay * elm_map_overlay_scale_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
1239 * Get the information of tile load status.
1241 * @param obj The map object.
1242 * @param try_num Pointer to store number of tiles download requested.
1243 * @param finish_num Pointer to store number of tiles successfully downloaded.
1245 * This gets the current tile loaded status for the map object.
1249 EAPI void elm_map_tile_load_status_get(const Evas_Object *obj, int *try_num, int *finish_num);
1252 * Get the names of available sources for a specific type.
1254 * @param obj The map object.
1255 * @param type source type.
1256 * @return The char pointer array of source names.
1258 * It will provide a list with all available sources.
1259 * Current source can be set by elm_map_source_set(), or get with
1260 * elm_map_source_get().
1262 * At least available sources of tile type:
1268 * At least available sources of route type:
1271 * At least available sources of name type:
1274 * @see elm_map_source_set()
1275 * @see elm_map_source_get()
1279 EAPI const char **elm_map_sources_get(const Evas_Object *obj, Elm_Map_Source_Type type);
1282 * Set the current source of the map for a specific type.
1284 * @param obj The map object.
1285 * @param type source type.
1286 * @param source_name The source to be used.
1288 * Map widget retrieves tile images that composes the map from a web service.
1289 * This web service can be set with this method
1290 * for ELM_MAP_SOURCE_TYPE_TILE type.
1291 * A different service can return a different maps with different
1292 * information and it can use different zoom values.
1294 * Map widget provides route data based on a external web service.
1295 * This web service can be set with this method
1296 * for ELM_MAP_SOURCE_TYPE_ROUTE type.
1298 * Map widget also provide geoname data based on a external web service.
1299 * This web service can be set with this method
1300 * for ELM_MAP_SOURCE_TYPE_NAME type.
1302 * The @p source_name need to match one of the names provided by
1303 * elm_map_sources_get().
1305 * The current source can be get using elm_map_source_get().
1307 * @see elm_map_sources_get()
1308 * @see elm_map_source_get()
1312 EAPI void elm_map_source_set(Evas_Object *obj, Elm_Map_Source_Type type, const char *source_name);
1315 * Get the name of currently used source for a specific type.
1317 * @param obj The map object.
1318 * @param type source type.
1319 * @return Returns the name of the source in use.
1321 * @see elm_map_sources_get()
1322 * @see elm_map_source_set()
1326 EAPI const char *elm_map_source_get(const Evas_Object *obj, Elm_Map_Source_Type type);
1329 * Add a new route to the map object.
1331 * @param obj The map object.
1332 * @param type The type of transport to be considered when tracing a route.
1333 * @param method The routing method, what should be prioritized.
1334 * @param flon The start longitude.
1335 * @param flat The start latitude.
1336 * @param tlon The destination longitude.
1337 * @param tlat The destination latitude.
1339 * @return The created route or @c NULL upon failure.
1341 * A route will be traced by point on coordinates (@p flat, @p flon)
1342 * to point on coordinates (@p tlat, @p tlon), using the route service
1343 * set with elm_map_source_set().
1345 * It will take @p type on consideration to define the route,
1346 * depending if the user will be walking or driving, the route may vary.
1347 * One of #ELM_MAP_ROUTE_TYPE_MOTOCAR, #ELM_MAP_ROUTE_TYPE_BICYCLE, or
1348 * #ELM_MAP_ROUTE_TYPE_FOOT need to be used.
1350 * Another parameter is what the route should prioritize, the minor distance
1351 * or the less time to be spend on the route. So @p method should be one
1352 * of #ELM_MAP_ROUTE_METHOD_SHORTEST or #ELM_MAP_ROUTE_METHOD_FASTEST.
1354 * Routes created with this method can be deleted with
1355 * elm_map_route_remove(),
1356 * and distance can be get with elm_map_route_distance_get().
1358 * @see elm_map_route_remove()
1359 * @see elm_map_route_distance_get()
1360 * @see elm_map_source_set()
1364 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);
1367 * Remove a route from the map.
1369 * @param route The route to remove.
1371 * @see elm_map_route_add()
1375 EAPI void elm_map_route_del(Elm_Map_Route *route);
1378 * Get the route distance in kilometers.
1380 * @param route The route object.
1381 * @return The distance of route (unit : km).
1385 EAPI double elm_map_route_distance_get(const Elm_Map_Route *route);
1388 * Get the information of route nodes.
1390 * @param route The route object.
1391 * @return Returns a string with the nodes of route.
1395 EAPI const char *elm_map_route_node_get(const Elm_Map_Route *route);
1398 * Get the information of route waypoint.
1400 * @param route the route object.
1401 * @return Returns a string with information about waypoint of route.
1405 EAPI const char *elm_map_route_waypoint_get(const Elm_Map_Route *route);
1408 * Request a address or geographic coordinates(longitude, latitude)
1409 * from a given address or geographic coordinate(longitude, latitude).
1411 * @param obj The map object.
1412 * @param address The address.
1413 * @param lon The longitude.
1414 * @param lat The latitude.
1415 * @param name_cb The callback function.
1416 * @param data The user callback data.
1417 * @return name A #Elm_Map_Name handle for this coordinate.
1419 * If you want to get address from geographic coordinates, set input @p address
1420 * as NULL and set @p lon, @p lat as you want to convert.
1421 * If address is set except NULL, @p lon and @p lat are checked.
1423 * To get the string for this address, elm_map_name_address_get()
1424 * should be used after callback or "name,loaded" signal is called.
1426 * To get the longitude and latitude, elm_map_name_region_get()
1431 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);
1434 * Get the address of the name.
1436 * @param name The name handle.
1437 * @return Returns the address string of @p name.
1439 * This gets the coordinates of the @p name, created with one of the
1440 * conversion functions.
1442 * @see elm_map_name_add()
1446 EAPI const char *elm_map_name_address_get(const Elm_Map_Name *name);
1449 * Get the current coordinates of the name.
1451 * @param name The name handle.
1452 * @param lat Pointer to store the latitude.
1453 * @param lon Pointer to store The longitude.
1455 * This gets the coordinates of the @p name, created with one of the
1456 * conversion functions.
1458 * @see elm_map_name_add()
1462 EAPI void elm_map_name_region_get(const Elm_Map_Name *name, double *lon, double *lat);
1465 * Remove a name from the map.
1467 * @param name The name to remove.
1469 * Basically the struct handled by @p name will be freed, so conversions
1470 * between address and coordinates will be lost.
1472 * @see elm_map_name_add()
1476 EAPI void elm_map_name_del(Elm_Map_Name *name);
1479 * Add a track on the map
1481 * @param obj The map object.
1482 * @param emap The emap route object.
1483 * @return The route object. This is an elm object of type Route.
1485 * @see elm_route_add() for details.
1489 EAPI Evas_Object *elm_map_track_add(Evas_Object *obj, void *emap);
1492 * Remove a track from the map
1494 * @param obj The map object.
1495 * @param route The track to remove.
1499 EAPI void elm_map_track_remove(Evas_Object *obj, Evas_Object *route);