1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 #define MARKER_MAX 1000
9 typedef struct Marker_Data
15 static Elm_Map_Marker_Class *itc1, *itc2, *itc_parking;
16 static Elm_Map_Group_Class *itc_group1, *itc_group2, *itc_group_parking;
18 static Evas_Object *rect;
20 static Elm_Map_Marker *markers[MARKER_MAX];
21 static Elm_Map_Marker *route_from, *route_to;
22 static Elm_Map_Route *route;
24 Marker_Data data1 = {PACKAGE_DATA_DIR"/images/logo.png"};
25 Marker_Data data2 = {PACKAGE_DATA_DIR"/images/logo_small.png"};
26 Marker_Data data3 = {PACKAGE_DATA_DIR"/images/panel_01.jpg"};
27 Marker_Data data4 = {PACKAGE_DATA_DIR"/images/plant_01.jpg"};
28 Marker_Data data5 = {PACKAGE_DATA_DIR"/images/rock_01.jpg"};
29 Marker_Data data6 = {PACKAGE_DATA_DIR"/images/rock_02.jpg"};
30 Marker_Data data7 = {PACKAGE_DATA_DIR"/images/sky_01.jpg"};
31 Marker_Data data8 = {PACKAGE_DATA_DIR"/images/sky_02.jpg"};
32 Marker_Data data9 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
33 Marker_Data data10 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
34 Marker_Data data11= {PACKAGE_DATA_DIR"/images/wood_01.jpg"};
36 Marker_Data data_parking= {PACKAGE_DATA_DIR"/images/parking.png"};
38 static Evas_Object * _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data);
39 static Evas_Object * _group_icon_get(Evas_Object *obj, void *data);
42 my_map_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
48 my_map_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
54 my_map_longpressed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
56 printf("longpressed\n");
60 my_map_clicked_double(void *data, Evas_Object *obj, void *event_info)
63 double flon, flat, tlon, tlat;
64 Evas_Coord ox, oy, x, y, w, h;
66 Evas_Event_Mouse_Up *down = (Evas_Event_Mouse_Up *)event_info;
69 evas_object_geometry_get(data, &ox, &oy, &w, &h);
70 zoom = elm_map_zoom_get(data);
72 elm_map_geo_region_get(obj, &lon, &lat);
73 elm_map_utils_convert_geo_into_coord(obj, lon, lat, pow(2.0, zoom)*256, &x, &y);
74 x += down->output.x - (w / 2) - ox;
75 y += down->output.y - (h / 2) - oy;
76 elm_map_utils_convert_coord_into_geo(obj, x, y, pow(2.0, zoom)*256, &lon, &lat);
78 itc1 = elm_map_marker_class_new(data);
80 elm_map_marker_class_del_cb_set(itc1, NULL);
82 itc_group1 = elm_map_group_class_new(data);
83 elm_map_group_class_icon_cb_set(itc_group1, _group_icon_get);
84 elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/bubble.png");
85 elm_map_group_class_style_set(itc_group1, "empty");
86 elm_map_group_class_zoom_displayed_set(itc_group1, 5);
88 if (route_from && route_to)
90 elm_map_marker_remove(route_from);
92 elm_map_marker_remove(route_to);
94 elm_map_route_remove(route);
97 if (!route_from) route_from = elm_map_marker_add(data, lon, lat, itc1, itc_group1, NULL);
98 else route_to = elm_map_marker_add(data, lon, lat, itc1, itc_group1, NULL);
100 if (route_from && route_to)
102 elm_map_marker_region_get(route_from, &flon, &flat);
103 elm_map_marker_region_get(route_to, &tlon, &tlat);
104 route = elm_map_route_add(data, ELM_MAP_ROUTE_TYPE_MOTOCAR, ELM_MAP_ROUTE_METHOD_FASTEST, flon, flat, tlon, tlat);
105 if (route) elm_map_route_color_set(route, 255, 0, 0, 255);
110 my_map_load_detail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
112 printf("load,detail\n");
116 my_map_loaded_detail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
118 printf("loaded,detail\n");
122 my_map_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
124 printf("zoom,start\n");
128 my_map_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
130 printf("zoom,stop\n");
134 my_map_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
136 printf("zoom,change\n");
140 my_map_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
142 printf("anim,start\n");
146 my_map_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
148 printf("anim,stop\n");
152 my_map_drag_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
154 printf("drag,start\n");
158 my_map_drag_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
160 printf("drag_stop\n");
164 my_map_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
167 elm_map_geo_region_get(obj, &lon, &lat);
168 printf("scroll longitude : %f latitude : %f\n", lon, lat);
172 my_map_downloaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
174 int try_num, finish_num;
175 elm_map_utils_downloading_status_get(data, &try_num, &finish_num);
176 printf("downloaded : %d / %d\n", finish_num, try_num);
180 my_map_route_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
182 printf("route_load\n");
186 my_map_route_loaded(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
190 d = elm_map_route_distance_get(route);
191 printf("route distance = %lf km\n", d);
193 w = elm_map_route_waypoint_get(route);
194 if (w) printf("[waypoints]\n%s\n", w);
196 n = elm_map_route_node_get(route);
197 if (n) printf("[nodes]\n%s\n", n);
201 my_bt_show_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
203 Eina_Bool b = elm_map_paused_get(data);
204 elm_map_paused_set(data, EINA_TRUE);
205 elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
206 elm_map_geo_region_show(data, 126.977969, 37.566535);
207 elm_map_zoom_set(data, 18);
208 elm_map_paused_set(data, b);
212 my_bt_bring_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
214 elm_map_geo_region_bring_in(data, 126.977969, 37.566535);
218 my_bt_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
222 zoom = elm_map_zoom_get(data);
224 elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
225 if (zoom >= (1.0 / 32.0)) elm_map_zoom_set(data, zoom);
229 my_bt_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
233 zoom = elm_map_zoom_get(data);
235 elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
236 if (zoom <= 256.0) elm_map_zoom_set(data, zoom);
240 my_bt_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
242 elm_map_paused_set(data, !elm_map_paused_get(data));
246 my_bt_markers_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
248 elm_map_paused_markers_set(data, !elm_map_paused_markers_get(data));
252 my_bt_zoom_fit(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
254 elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FIT);
258 my_bt_zoom_fill(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
260 elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FILL);
264 my_bt_source_mapnik(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
266 elm_map_source_set(data, ELM_MAP_SOURCE_MAPNIK);
270 my_bt_source_osmarender(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
272 elm_map_source_set(data, ELM_MAP_SOURCE_OSMARENDER);
276 my_bt_source_cyclemap(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
278 elm_map_source_set(data, ELM_MAP_SOURCE_CYCLEMAP);
282 my_bt_source_maplint(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
284 elm_map_source_set(data, ELM_MAP_SOURCE_MAPLINT);
288 my_bt_source_module(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
290 elm_map_source_set(data, ELM_MAP_SOURCE_MODULE);
294 my_bt_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
297 Elm_Map_Group_Class *g_clas;
298 Elm_Map_Marker_Class *m_clas;
299 Marker_Data *d = &data7;
301 if (*markers) return;
302 for(i =0; i<MARKER_MAX; i++)
306 int r1 = rand() % (180*2*100);
307 if(r1<=180) r1 = -r1;
308 else r1 = r1 - 180*100;
310 int r2 = rand() % (85*2*100);
312 else r2 = r2 - 85*100;
314 int style = rand() % 3;
315 if (!style) m_clas = itc1;
316 else if (style == 1) m_clas = itc2;
319 m_clas = itc_parking;
324 if (!style) g_clas = itc_group1;
325 else g_clas = itc_group2;
327 markers[i] = elm_map_marker_add(data, r1/100., r2/100., m_clas, g_clas, d);
330 printf("nb elements: %d\n", nb_elts);
334 my_bt_remove(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
338 for (i = 0; i<MARKER_MAX; i++)
342 elm_map_marker_remove(markers[i]);
349 _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data)
351 Marker_Data *d = data;
353 Evas_Object *bx = elm_box_add(obj);
354 evas_object_show(bx);
358 Evas_Object *icon = elm_icon_add(obj);
359 elm_icon_file_set(icon, d->file, NULL);
360 evas_object_show(icon);
362 Evas_Object *o = elm_button_add(obj);
363 elm_button_icon_set(o, icon);
365 elm_box_pack_end(bx, o);
369 Evas_Object *o = evas_object_image_add(evas_object_evas_get(obj));
370 evas_object_image_file_set(o, d->file, NULL);
371 evas_object_image_filled_set(o, EINA_TRUE);
372 evas_object_size_hint_min_set(o, 64, 64);
374 elm_box_pack_end(bx, o);
376 Evas_Object *lbl = elm_label_add(obj);
377 elm_label_label_set(lbl, "Wolves Go !");
378 evas_object_show(lbl);
379 elm_box_pack_end(bx, lbl);
386 _icon_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data)
388 Marker_Data *d = data;
390 Evas_Object *icon = elm_icon_add(obj);
391 elm_icon_file_set(icon, d->file, NULL);
392 evas_object_show(icon);
398 _group_icon_get(Evas_Object *obj, void *data)
402 Evas_Object *icon = elm_icon_add(obj);
403 elm_icon_file_set(icon, file, NULL);
404 evas_object_show(icon);
410 _map_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
412 Evas_Object *map = data;
413 Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info;
415 //unset the mouse wheel
416 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
418 zoom = elm_map_zoom_get(map);
425 elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL);
426 if ((zoom >= 0) && (zoom <= 18)) elm_map_zoom_set(map, zoom);
430 _map_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
434 evas_object_geometry_get(data,&x,&y,&w,&h);
435 evas_object_resize(rect,w,h);
436 evas_object_move(rect,x,y);
440 test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
442 Evas_Object *win, *bg, *map, *tb2, *bt, *bx;
444 win = elm_win_add(NULL, "map", ELM_WIN_BASIC);
445 elm_win_title_set(win, "Map");
446 elm_win_autodel_set(win, 1);
448 bg = elm_bg_add(win);
449 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
450 elm_win_resize_object_add(win, bg);
451 evas_object_show(bg);
453 map = elm_map_add(win);
458 evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
459 elm_win_resize_object_add(win, map);
460 evas_object_data_set(map, "window", win);
463 itc1 = elm_map_marker_class_new(map);
464 elm_map_marker_class_get_cb_set(itc1, _marker_get);
465 elm_map_marker_class_del_cb_set(itc1, NULL);
467 itc2 = elm_map_marker_class_new(map);
468 elm_map_marker_class_get_cb_set(itc2, _marker_get);
469 elm_map_marker_class_del_cb_set(itc2, NULL);
470 elm_map_marker_class_style_set(itc2, "radio2");
472 itc_parking = elm_map_marker_class_new(map);
473 elm_map_marker_class_get_cb_set(itc_parking, _marker_get);
474 elm_map_marker_class_del_cb_set(itc_parking, NULL);
475 elm_map_marker_class_icon_cb_set(itc_parking, _icon_get);
476 elm_map_marker_class_style_set(itc_parking, "empty");
480 itc_group1 = elm_map_group_class_new(map);
481 elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/plant_01.jpg");
483 itc_group2 = elm_map_group_class_new(map);
484 elm_map_group_class_style_set(itc_group2, "radio2");
485 elm_map_group_class_zoom_displayed_set(itc_group1, 3);
487 itc_group_parking = elm_map_group_class_new(map);
488 elm_map_group_class_icon_cb_set(itc_group_parking, _group_icon_get);
489 elm_map_group_class_data_set(itc_group_parking, (void *)PACKAGE_DATA_DIR"/images/parking.png");
490 elm_map_group_class_style_set(itc_group_parking, "empty");
491 elm_map_group_class_zoom_displayed_set(itc_group_parking, 5);
495 rect = evas_object_rectangle_add(evas_object_evas_get(win));
496 evas_object_color_set(rect, 0, 0, 0, 0);
497 evas_object_repeat_events_set(rect,1);
498 evas_object_show(rect);
499 evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_WHEEL,
500 _map_mouse_wheel_cb, map);
501 evas_object_raise(rect);
503 evas_object_event_callback_add(map, EVAS_CALLBACK_RESIZE,
504 _map_move_resize_cb, map);
505 evas_object_event_callback_add(map, EVAS_CALLBACK_MOVE,
506 _map_move_resize_cb, map);
508 elm_map_marker_add(map, 2.352, 48.857, itc1, itc_group1, &data1);
509 elm_map_marker_add(map, 2.355, 48.857, itc1, itc_group1, &data3);
510 elm_map_marker_add(map, 3, 48.857, itc2, itc_group1, &data2);
511 elm_map_marker_add(map, 2.352, 49, itc2, itc_group1, &data1);
513 elm_map_marker_add(map, 7.31451, 48.857127, itc1, itc_group1, &data10);
514 elm_map_marker_add(map, 7.314704, 48.857119, itc1, itc_group1, &data4);
515 elm_map_marker_add(map, 7.314704, 48.857119, itc2, itc_group1, &data5);
516 elm_map_marker_add(map, 7.31432, 48.856785, itc2, itc_group1, &data6);
517 elm_map_marker_add(map, 7.3148, 48.85725, itc1, itc_group2, &data7);
518 elm_map_marker_add(map, 7.316445, 48.8572210000694, itc1, itc_group1, &data8);
519 elm_map_marker_add(map, 7.316527000125, 48.85609, itc2, itc_group2, &data9);
520 elm_map_marker_add(map, 7.3165409990833, 48.856078, itc2, itc_group1, &data11);
521 elm_map_marker_add(map, 7.319812, 48.856561, itc2, itc_group2, &data10);
525 evas_object_smart_callback_add(map, "clicked", my_map_clicked, win);
526 evas_object_smart_callback_add(map, "press", my_map_press, win);
527 evas_object_smart_callback_add(map, "longpressed", my_map_longpressed, win);
528 evas_object_smart_callback_add(map, "clicked,double", my_map_clicked_double, map);
529 evas_object_smart_callback_add(map, "load,detail", my_map_load_detail, win);
530 evas_object_smart_callback_add(map, "loaded,detail", my_map_loaded_detail, win);
531 evas_object_smart_callback_add(map, "zoom,start", my_map_zoom_start, win);
532 evas_object_smart_callback_add(map, "zoom,stop", my_map_zoom_stop, win);
533 evas_object_smart_callback_add(map, "zoom,change", my_map_zoom_change, win);
534 evas_object_smart_callback_add(map, "scroll,anim,start", my_map_anim_start, win);
535 evas_object_smart_callback_add(map, "scroll,anim,stop", my_map_anim_stop, win);
536 evas_object_smart_callback_add(map, "scroll,drag,start", my_map_drag_start, win);
537 evas_object_smart_callback_add(map, "scroll,drag,stop", my_map_drag_stop, win);
538 evas_object_smart_callback_add(map, "scroll", my_map_scroll, win);
539 evas_object_smart_callback_add(map, "downloaded", my_map_downloaded, map);
540 evas_object_smart_callback_add(map, "route,load", my_map_route_load, map);
541 evas_object_smart_callback_add(map, "route,loaded", my_map_route_loaded, map);
543 evas_object_show(map);
545 tb2 = elm_table_add(win);
546 evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
547 elm_win_resize_object_add(win, tb2);
549 bt = elm_button_add(win);
550 elm_button_label_set(bt, "Z -");
551 evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_out, map);
552 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
553 evas_object_size_hint_align_set(bt, 0.1, 0.1);
554 elm_table_pack(tb2, bt, 0, 0, 1, 1);
555 evas_object_show(bt);
557 bt = elm_button_add(win);
558 elm_button_label_set(bt, "Z +");
559 evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_in, map);
560 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
561 evas_object_size_hint_align_set(bt, 0.9, 0.1);
562 elm_table_pack(tb2, bt, 2, 0, 1, 1);
563 evas_object_show(bt);
565 bx = elm_box_add(win);
566 evas_object_show(bx);
567 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
568 evas_object_size_hint_align_set(bx, 0.5, 0.1);
569 elm_table_pack(tb2, bx, 1, 0, 1, 1);
572 bt = elm_button_add(win);
573 elm_button_label_set(bt, "Add 1000 markers");
574 evas_object_smart_callback_add(bt, "clicked", my_bt_add, map);
575 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
576 evas_object_size_hint_align_set(bt, 0.5, 0.1);
577 evas_object_show(bt);
578 elm_box_pack_end(bx, bt);
580 bt = elm_button_add(win);
581 elm_button_label_set(bt, "remove 1000 markers");
582 evas_object_smart_callback_add(bt, "clicked", my_bt_remove, map);
583 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
584 evas_object_size_hint_align_set(bt, 0.5, 0.1);
585 evas_object_show(bt);
586 elm_box_pack_end(bx, bt);
589 bt = elm_button_add(win);
590 elm_button_label_set(bt, "Show Seoul");
591 evas_object_smart_callback_add(bt, "clicked", my_bt_show_reg, map);
592 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
593 evas_object_size_hint_align_set(bt, 0.1, 0.5);
594 elm_table_pack(tb2, bt, 0, 1, 1, 1);
595 evas_object_show(bt);
597 bt = elm_button_add(win);
598 elm_button_label_set(bt, "Bring Seoul");
599 evas_object_smart_callback_add(bt, "clicked", my_bt_bring_reg, map);
600 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
601 evas_object_size_hint_align_set(bt, 0.9, 0.5);
602 elm_table_pack(tb2, bt, 2, 1, 1, 1);
603 evas_object_show(bt);
606 bx = elm_box_add(win);
607 evas_object_show(bx);
608 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
609 evas_object_size_hint_align_set(bx, 0.1, 0.9);
610 elm_table_pack(tb2, bx, 0, 2, 1, 1);
612 bt = elm_button_add(win);
613 elm_button_label_set(bt, "Pause On/Off");
614 evas_object_smart_callback_add(bt, "clicked", my_bt_pause, map);
615 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
616 evas_object_size_hint_align_set(bt, 0.1, 0.9);
617 evas_object_show(bt);
618 elm_box_pack_end(bx, bt);
620 bt = elm_button_add(win);
621 elm_button_label_set(bt, "Markers pause On/Off");
622 evas_object_smart_callback_add(bt, "clicked", my_bt_markers_pause, map);
623 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
624 evas_object_size_hint_align_set(bt, 0.1, 0.9);
625 evas_object_show(bt);
626 elm_box_pack_end(bx, bt);
630 bx = elm_box_add(win);
631 evas_object_show(bx);
632 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
633 evas_object_size_hint_align_set(bx, 0.5, 0.9);
634 elm_table_pack(tb2, bx, 1, 2, 1, 1);
636 bt = elm_button_add(win);
637 elm_button_label_set(bt, "Fit");
638 evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_fit, map);
639 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
640 evas_object_size_hint_align_set(bt, 0.5, 0.9);
641 evas_object_show(bt);
642 elm_box_pack_end(bx, bt);
644 bt = elm_button_add(win);
645 elm_button_label_set(bt, "Fill");
646 evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_fill, map);
647 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
648 evas_object_size_hint_align_set(bt, 0.5, 0.9);
649 evas_object_show(bt);
650 elm_box_pack_end(bx, bt);
654 bx = elm_box_add(win);
655 evas_object_show(bx);
656 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
657 evas_object_size_hint_align_set(bx, 1.0, 0.9);
658 elm_table_pack(tb2, bx, 2, 2, 1, 1);
660 bt = elm_button_add(win);
661 elm_button_label_set(bt, "Mapnik");
662 evas_object_smart_callback_add(bt, "clicked", my_bt_source_mapnik, map);
663 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
664 evas_object_size_hint_align_set(bt, 1.0, 0.9);
665 evas_object_show(bt);
666 elm_box_pack_end(bx, bt);
668 bt = elm_button_add(win);
669 elm_button_label_set(bt, "Osmarender");
670 evas_object_smart_callback_add(bt, "clicked", my_bt_source_osmarender, map);
671 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
672 evas_object_size_hint_align_set(bt, 1.0, 0.9);
673 evas_object_show(bt);
674 elm_box_pack_end(bx, bt);
676 bt = elm_button_add(win);
677 elm_button_label_set(bt, "Cycle Map");
678 evas_object_smart_callback_add(bt, "clicked", my_bt_source_cyclemap, map);
679 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
680 evas_object_size_hint_align_set(bt, 1.0, 0.9);
681 evas_object_show(bt);
682 elm_box_pack_end(bx, bt);
684 bt = elm_button_add(win);
685 elm_button_label_set(bt, "Maplint");
686 evas_object_smart_callback_add(bt, "clicked", my_bt_source_maplint, map);
687 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
688 evas_object_size_hint_align_set(bt, 1.0, 0.9);
689 evas_object_show(bt);
690 elm_box_pack_end(bx, bt);
692 bt = elm_button_add(win);
693 elm_button_label_set(bt, "Module");
694 evas_object_smart_callback_add(bt, "clicked", my_bt_source_module, map);
695 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
696 evas_object_size_hint_align_set(bt, 1.0, 0.9);
697 evas_object_show(bt);
698 elm_box_pack_end(bx, bt);
701 evas_object_show(tb2);
704 evas_object_resize(win, 800, 800);
705 evas_object_show(win);