efl/src/examples/elementary/map_example_03.c

196 lines
5.8 KiB
C
Raw Normal View History

/**
* Simple Elementary's <b>map widget</b> example, illustrating route and
* name usage.
*
* See stdout/stderr for output. Compile with:
*
* @verbatim
* gcc -g map_example_03.c -o map_example_03 `pkg-config --cflags --libs elementary`
* @endverbatim
*/
#include <Elementary.h>
typedef struct _Example_Data
{
Evas_Object *map, *entry;
Elm_Map_Route *route;
double start_lon, start_lat, dest_lon, dest_lat;
Elm_Map_Name *name;
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
Elm_Map_Overlay *route_ovl;
} Example_Data;
static Example_Data example_data;
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
static void
_route_loaded(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
{
Example_Data *exam_data = data;
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
exam_data->route_ovl = elm_map_overlay_route_add(obj, exam_data->route);
elm_map_overlay_color_set(exam_data->route_ovl, 0, 255, 0, 255);
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
}
static void
_name_loaded(void *data, Evas_Object *obj, void *ev EINA_UNUSED)
{
Example_Data *exam_data = data;
Evas_Object *map = obj;
if (exam_data->route)
elm_map_route_del(exam_data->route);
elm_map_name_region_get(exam_data->name, &(exam_data->dest_lon),
&(exam_data->dest_lat));
exam_data->route = elm_map_route_add(map, ELM_MAP_ROUTE_TYPE_FOOT,
2013-04-04 00:45:09 -07:00
ELM_MAP_ROUTE_METHOD_SHORTEST,
exam_data->start_lon, exam_data->start_lat,
exam_data->dest_lon, exam_data->dest_lat,
NULL, NULL);
}
static void
_bt_route(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
Example_Data *exam_data = data;
Evas_Object *map;
char *address;
map = exam_data->map;
address = (char *)elm_object_text_get(exam_data->entry);
exam_data->name = elm_map_name_add(map, address, 0, 0, NULL, NULL);
evas_object_smart_callback_add(map, "name,loaded", _name_loaded, data);
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
evas_object_smart_callback_add(map, "route,loaded", _route_loaded, data);
}
static void
_bt_zoom_in(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
int zoom;
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Add overlay in the map I made a overlay APIs in the map. This will replace the marker APIs. I hope that markers will be deleted before elementary 1.0 release. This was discussed before in http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2 Marker only supports layout style overlay. So only icon and image are suitable for marker. For now on, overlay can support any evas object and also layout style. Currently overlay support default, bubble, and class types. And more types will be added (Polyline, Polygon, scale, POI etc.). I made a Elm_Map_Overlay opaque structure for handling general overlay properties (hide, pause, show, etc.) and coordinates or internal content (icon, content, etc.) for those different types. Class type overlay is something like mixture of previous marker group and marker class. If member overlays in the same class are closed, they will be grouped. (Same functionality as previous maker group.) The group's properties and contents are defined by using general overlay functions. (New functionality) This defined properties and contents can be be propagated to member overlays appended to this class. (Same functionality as previous maker class.) There are some missing functionalities remained. Group callbacks are not supported yet in the overlays. So images inside group bubble can not be shown. I will implement this feature. After this patch, I will fix signals and function names before elementary 1.0 releases. SVN revision: 68672
2012-03-04 20:18:33 -08:00
elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
zoom = elm_map_zoom_get(data);
elm_map_zoom_set(data, zoom + 1);
}
static void
_bt_zoom_out(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
{
int zoom;
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Add overlay in the map I made a overlay APIs in the map. This will replace the marker APIs. I hope that markers will be deleted before elementary 1.0 release. This was discussed before in http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2 Marker only supports layout style overlay. So only icon and image are suitable for marker. For now on, overlay can support any evas object and also layout style. Currently overlay support default, bubble, and class types. And more types will be added (Polyline, Polygon, scale, POI etc.). I made a Elm_Map_Overlay opaque structure for handling general overlay properties (hide, pause, show, etc.) and coordinates or internal content (icon, content, etc.) for those different types. Class type overlay is something like mixture of previous marker group and marker class. If member overlays in the same class are closed, they will be grouped. (Same functionality as previous maker group.) The group's properties and contents are defined by using general overlay functions. (New functionality) This defined properties and contents can be be propagated to member overlays appended to this class. (Same functionality as previous maker class.) There are some missing functionalities remained. Group callbacks are not supported yet in the overlays. So images inside group bubble can not be shown. I will implement this feature. After this patch, I will fix signals and function names before elementary 1.0 releases. SVN revision: 68672
2012-03-04 20:18:33 -08:00
elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
zoom = elm_map_zoom_get(data);
elm_map_zoom_set(data, zoom - 1);
}
static void
_bt_zoom_fit(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Add overlay in the map I made a overlay APIs in the map. This will replace the marker APIs. I hope that markers will be deleted before elementary 1.0 release. This was discussed before in http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2 Marker only supports layout style overlay. So only icon and image are suitable for marker. For now on, overlay can support any evas object and also layout style. Currently overlay support default, bubble, and class types. And more types will be added (Polyline, Polygon, scale, POI etc.). I made a Elm_Map_Overlay opaque structure for handling general overlay properties (hide, pause, show, etc.) and coordinates or internal content (icon, content, etc.) for those different types. Class type overlay is something like mixture of previous marker group and marker class. If member overlays in the same class are closed, they will be grouped. (Same functionality as previous maker group.) The group's properties and contents are defined by using general overlay functions. (New functionality) This defined properties and contents can be be propagated to member overlays appended to this class. (Same functionality as previous maker class.) There are some missing functionalities remained. Group callbacks are not supported yet in the overlays. So images inside group bubble can not be shown. I will implement this feature. After this patch, I will fix signals and function names before elementary 1.0 releases. SVN revision: 68672
2012-03-04 20:18:33 -08:00
elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FIT);
}
static void
_bt_zoom_fill(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Add overlay in the map I made a overlay APIs in the map. This will replace the marker APIs. I hope that markers will be deleted before elementary 1.0 release. This was discussed before in http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2 Marker only supports layout style overlay. So only icon and image are suitable for marker. For now on, overlay can support any evas object and also layout style. Currently overlay support default, bubble, and class types. And more types will be added (Polyline, Polygon, scale, POI etc.). I made a Elm_Map_Overlay opaque structure for handling general overlay properties (hide, pause, show, etc.) and coordinates or internal content (icon, content, etc.) for those different types. Class type overlay is something like mixture of previous marker group and marker class. If member overlays in the same class are closed, they will be grouped. (Same functionality as previous maker group.) The group's properties and contents are defined by using general overlay functions. (New functionality) This defined properties and contents can be be propagated to member overlays appended to this class. (Same functionality as previous maker class.) There are some missing functionalities remained. Group callbacks are not supported yet in the overlays. So images inside group bubble can not be shown. I will implement this feature. After this patch, I will fix signals and function names before elementary 1.0 releases. SVN revision: 68672
2012-03-04 20:18:33 -08:00
elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FILL);
}
/* FIXME: it shouldn't be required. For unknown reason map won't call
* pan_calculate until shot delay time, but then it will take a screenshot
* when the map isn't loaded yet (actually it won't be downloaded, because
* after the SS it will kill the example). */
static Eina_Bool
_nasty_hack(void *data)
{
Evas_Object *o = data;
Evas *e = evas_object_evas_get(o);
evas_smart_objects_calculate(e);
return ECORE_CALLBACK_CANCEL;
}
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Evas_Object *win, *map, *box, *bt, *entry;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("map", "Map Route Example");
elm_win_autodel_set(win, EINA_TRUE);
map = elm_map_add(win);
evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, map);
evas_object_show(map);
box = elm_box_add(win);
elm_box_horizontal_set(box, EINA_TRUE);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, box);
evas_object_show(box);
bt = elm_button_add(win);
elm_object_text_set(bt, "+");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_in, map);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
bt = elm_button_add(win);
elm_object_text_set(bt, "-");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_out, map);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
bt = elm_button_add(win);
elm_object_text_set(bt, "X");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_fit, map);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
bt = elm_button_add(win);
elm_object_text_set(bt, "#");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_zoom_fill, map);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
entry = elm_entry_add(win);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_object_text_set(entry, "Jockey Club Brasileiro");
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0);
elm_box_pack_end(box, entry);
evas_object_show(entry);
bt = elm_button_add(win);
elm_object_text_set(bt, "Route");
elm_box_pack_end(box, bt);
evas_object_show(bt);
evas_object_smart_callback_add(bt, "clicked", _bt_route, &example_data);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
example_data.map = map;
example_data.entry = entry;
example_data.route = NULL;
example_data.start_lon = -43.175;
example_data.start_lat = -22.97;
elm_map_zoom_set(map, 12);
From: Bluezery <ohpowel@gmail.com> Subject: [E-devel] [Patch][elm_map] Change & Add map APIs I rename & add some APIs. As previously discussed, I categorized map APIs. (http://marc.info/?l=enlightenment-devel&m=132685497711772&w=2) 1) Zoom elm_map_zoom_set/get elm_map_zoom_mode_set/get elm_map_zoom_min_set/get elm_map_zoom_max_set/get 2) Region - Geographic coordinates (region) elm_map_region_get elm_map_region_show/bring_in elm_map_canvas_to_region_convert I will not use "_geo_" in map APIs. All map APIs are basically used by geographic coordinates. 3) Property elm_map_paused_set/get elm_map_rotate_set/get elm_map_wheel_disabled_set/get elm_map_user_agent_set/get 4) Overlay elm_map_overlay_add/del elm_map_overlay_xxx elm_map_overlay_class_xxx elm_map_overlay_bubble_xxx elm_map_overlay_route_xxx I will add line, rectangle, poi overlays ASAP. 5) Source - External Provider (Tile, Route, Name, ) elm_map_sources_get elm_map_source_set/get I will add more provider ASAP such as POI, etc. 6) Route elm_map_route_add/del elm_map_route_distance_get elm_map_route_node_get elm_map_route_waypoints_get 7) Name elm_map_name_add/del elm_map_route_address_get elm_map_route_region_get 6) Route and 7) Name do not return visible objects actually. Those just return data. I don't know "_add" suffix is correct for none visible objects. I cannot decide yet whether those should be removed from map widget. But current trends are that route, geocoding are tightly coupled with Map. If Apps want to use only data, just use elm_map_route_add(). If not, use elm_map_route_add() & elm_map_overlay_route_add(). Also name overlay could be added in the future. 8) Miscellaneous elm_map_tile_load_status_get 9) Signals Basic events : "clicked", "clicked,double", "press", "longpressed", Scroller events: "scroll", "scroll,xxx,xxx" Zoom events: "zoom,start/stop/change" Source (provider) events: "tile,load/loaded/loaded,fail" , "route,load/loaded/loaded,fail", "name,load/loaded/loaded,fail" There are some big patches. I think diff program do not make exact diff. :D. Anyway, it's better to maintain if this can be in before API fix (elementary 1.0). Because after these change, It is hard to maintain old APIs. PS) Documentations and some minor bugs are remained yet. SVN revision: 68915
2012-03-07 01:28:08 -08:00
elm_map_region_show(map, example_data.start_lon, example_data.start_lat);
evas_object_resize(win, 512, 512);
evas_object_show(win);
ecore_timer_add(0.5, _nasty_hack, win);
elm_run();
return 0;
}
ELM_MAIN()