fix conflict test_focus.c
[framework/uifw/elementary.git] / src / bin / test_map.c
1 #include <Elementary.h>
2 #ifdef HAVE_CONFIG_H
3 # include "elementary_config.h"
4 #endif
5 #ifndef ELM_LIB_QUICKLAUNCH
6
7 #define SOURCE_MAX 10
8 #define MARKER_MAX 1000
9 #define NAME_ENTRY_TEXT "Enter freeform address"
10
11 <<<<<<< HEAD
12 typedef struct Marker_Data
13 {
14    const char *file;
15 } Marker_Data;
16 =======
17 typedef struct Overlay_Data
18 {
19    const char *file;
20 } Overlay_Data;
21 >>>>>>> remotes/origin/upstream
22
23 typedef struct Map_Source
24 {
25    Evas_Object *map;
26    char *source_name;
27 } Map_Source;
28
29 <<<<<<< HEAD
30 static Elm_Map_Marker_Class *itc1, *itc2, *itc_parking;
31 static Elm_Map_Group_Class *itc_group1, *itc_group2, *itc_group_parking;
32
33 static Evas_Object *rect, *menu, *fs_win;
34 static int nb_elts;
35 /*static Elm_Map_Marker *markers[MARKER_MAX];*/
36 static Elm_Map_Marker *route_from, *route_to;
37 =======
38 Overlay_Data data1 = {PACKAGE_DATA_DIR"/images/logo.png"};
39 Overlay_Data data2 = {PACKAGE_DATA_DIR"/images/logo_small.png"};
40 Overlay_Data data3 = {PACKAGE_DATA_DIR"/images/panel_01.jpg"};
41 Overlay_Data data4 = {PACKAGE_DATA_DIR"/images/plant_01.jpg"};
42 Overlay_Data data5 = {PACKAGE_DATA_DIR"/images/rock_01.jpg"};
43 Overlay_Data data6 = {PACKAGE_DATA_DIR"/images/rock_02.jpg"};
44 Overlay_Data data7 = {PACKAGE_DATA_DIR"/images/sky_01.jpg"};
45 Overlay_Data data8 = {PACKAGE_DATA_DIR"/images/sky_02.jpg"};
46 Overlay_Data data9 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
47 Overlay_Data data10 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
48 Overlay_Data data11= {PACKAGE_DATA_DIR"/images/wood_01.jpg"};
49 Overlay_Data parking= {PACKAGE_DATA_DIR"/images/parking.png"};
50 Overlay_Data icon_data = {PACKAGE_DATA_DIR"/images/icon_14.png"};
51
52 static Elm_Map_Overlay *route_start, *route_end, *route_clas;
53 static Elm_Map_Overlay *bubble_img;
54 static Elm_Map_Overlay *bubble_parking;
55 static Elm_Map_Overlay *route_ovl;
56
57 static Evas_Object *menu, *fs_win;
58 >>>>>>> remotes/origin/upstream
59 static Elm_Map_Route *route;
60 static Elm_Map_Name *name;
61 static Evas_Object *track;
62 static const char **source_names = NULL;
63 static Evas_Coord old_x, old_y;
64 static Evas_Coord old_d;
65 static Map_Source ms[SOURCE_MAX];
66
67 <<<<<<< HEAD
68 Marker_Data data1 = {PACKAGE_DATA_DIR"/images/logo.png"};
69 Marker_Data data2 = {PACKAGE_DATA_DIR"/images/logo_small.png"};
70 Marker_Data data3 = {PACKAGE_DATA_DIR"/images/panel_01.jpg"};
71 Marker_Data data4 = {PACKAGE_DATA_DIR"/images/plant_01.jpg"};
72 Marker_Data data5 = {PACKAGE_DATA_DIR"/images/rock_01.jpg"};
73 Marker_Data data6 = {PACKAGE_DATA_DIR"/images/rock_02.jpg"};
74 Marker_Data data7 = {PACKAGE_DATA_DIR"/images/sky_01.jpg"};
75 Marker_Data data8 = {PACKAGE_DATA_DIR"/images/sky_02.jpg"};
76 Marker_Data data9 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
77 Marker_Data data10 = {PACKAGE_DATA_DIR"/images/sky_03.jpg"};
78 Marker_Data data11= {PACKAGE_DATA_DIR"/images/wood_01.jpg"};
79
80 Marker_Data data_parking= {PACKAGE_DATA_DIR"/images/parking.png"};
81
82 static Evas_Object * _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data);
83 static Evas_Object * _group_icon_get(Evas_Object *obj, void *data);
84
85 =======
86 >>>>>>> remotes/origin/upstream
87 static void
88 #ifdef ELM_EMAP
89 my_map_gpx_fileselector_done(void *data, Evas_Object *obj __UNUSED__, void *event_info)
90 #else
91 my_map_gpx_fileselector_done(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
92 #endif
93 {
94    const char *selected = event_info;
95
96    if (selected)
97      {
98         printf("Selected file: %s\n", selected);
99 #ifdef ELM_EMAP
100         EMap_Route *emap = emap_route_gpx_new(selected);
101         track = elm_map_track_add(data, emap);
102 #else
103         printf("libEMap is required !\n");
104 #endif
105      }
106    evas_object_del(fs_win);
107 }
108
109 <<<<<<< HEAD
110 static void
111 my_map_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
112 {
113    printf("clicked\n");
114 }
115
116 static void
117 my_map_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
118 {
119    printf("press\n");
120 }
121
122 static void
123 my_map_longpressed(void *data __UNUSED__, Evas_Object *obj, void *event_info)
124 {
125    printf("longpressed\n");
126    double lon, lat;
127    Evas_Event_Mouse_Down *down = (Evas_Event_Mouse_Down *)event_info;
128    if (!down) return;
129    if (elm_map_zoom_get(obj) < 5) return;
130
131    elm_map_canvas_to_geo_convert(obj, down->canvas.x, down->canvas.y, &lon, &lat);
132    printf("x:%d, y:%d, lon:%lf, lat:%lf\n", down->canvas.x, down->canvas.y, lon, lat);
133    name = elm_map_utils_convert_coord_into_name(obj, lon, lat);
134 }
135
136 static void
137 my_map_clicked_double(void *data __UNUSED__, Evas_Object *obj, void *event_info)
138 {
139    printf("clicked,double\n");
140    double lon, lat;
141    double flon, flat, tlon, tlat;
142 =======
143 static Evas_Object *
144 _route_icon_get(Evas_Object *obj)
145 {
146    Evas_Object *icon = elm_icon_add(obj);
147    elm_icon_file_set(icon, PACKAGE_DATA_DIR"/images/bubble.png", NULL);
148    evas_object_show(icon);
149
150    return icon;
151 }
152
153 static void
154 _map_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
155 {
156    printf("clicked\n");
157 }
158
159 static void
160 _map_clicked_double(void *data __UNUSED__, Evas_Object *obj, void *event_info)
161 {
162    printf("clicked,double\n");
163    double lon, lat;
164 >>>>>>> remotes/origin/upstream
165    Evas_Event_Mouse_Down *down = (Evas_Event_Mouse_Down *)event_info;
166    if (!down) return;
167    if (elm_map_zoom_get(obj) < 5) return;
168
169 <<<<<<< HEAD
170    elm_map_canvas_to_geo_convert(obj, down->canvas.x, down->canvas.y, &lon, &lat);
171    printf("x:%d, y:%d, lon:%lf, lat:%lf\n", down->canvas.x, down->canvas.y, lon, lat);
172    itc1 = elm_map_marker_class_new(obj);
173
174    elm_map_marker_class_del_cb_set(itc1, NULL);
175
176    itc_group1 = elm_map_group_class_new(obj);
177    elm_map_group_class_icon_cb_set(itc_group1, _group_icon_get);
178    elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/bubble.png");
179    elm_map_group_class_style_set(itc_group1, "empty");
180    elm_map_group_class_zoom_displayed_set(itc_group1, 5);
181
182    if (route_from && route_to)
183      {
184         elm_map_marker_remove(route_from);
185         route_from = NULL;
186         elm_map_marker_remove(route_to);
187         route_to = NULL;
188         elm_map_route_remove(route);
189      }
190
191    if (!route_from) route_from = elm_map_marker_add(obj, lon, lat, itc1, itc_group1, NULL);
192    else route_to = elm_map_marker_add(obj, lon, lat, itc1, itc_group1, NULL);
193
194    if (route_from && route_to)
195      {
196         elm_map_marker_region_get(route_from, &flon, &flat);
197         elm_map_marker_region_get(route_to, &tlon, &tlat);
198         route = elm_map_route_add(obj, ELM_MAP_ROUTE_TYPE_MOTOCAR, ELM_MAP_ROUTE_METHOD_FASTEST, flon, flat, tlon, tlat);
199         elm_map_route_color_set(route, 255, 0, 0, 255);
200 =======
201    elm_map_canvas_to_region_convert(obj, down->canvas.x, down->canvas.y, &lon, &lat);
202    printf("x:%d, y:%d, lon:%lf, lat:%lf\n", down->canvas.x, down->canvas.y, lon, lat);
203
204    if (!route_clas)
205      {
206         route_clas = elm_map_overlay_class_add(obj);
207         elm_map_overlay_icon_set(route_clas, _route_icon_get(obj));
208         elm_map_overlay_displayed_zoom_min_set(route_clas, 5);
209      }
210
211    if (route_start && route_end)
212      {
213         elm_map_overlay_del(route_start);
214         elm_map_overlay_del(route_end);
215         route_start = NULL;
216         route_end = NULL;
217         route = NULL;
218      }
219
220    if (!route_start) route_start = elm_map_overlay_add(obj, lon, lat);
221    else route_end = elm_map_overlay_add(obj, lon, lat);
222
223    if (route_start && route_end)
224      {
225         double start_lon, start_lat, end_lon, end_lat;
226         elm_map_overlay_class_append(route_clas, route_start);
227         elm_map_overlay_class_append(route_clas, route_end);
228         elm_map_overlay_region_get(route_start, &start_lon, &start_lat);
229         elm_map_overlay_region_get(route_end, &end_lon, &end_lat);
230         route = elm_map_route_add(obj, ELM_MAP_ROUTE_TYPE_MOTOCAR,
231                                      ELM_MAP_ROUTE_METHOD_FASTEST,
232                                      start_lon, start_lat, end_lon, end_lat,
233                                      NULL, NULL);
234 >>>>>>> remotes/origin/upstream
235      }
236 }
237
238 static void
239 <<<<<<< HEAD
240 my_map_load_detail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
241 {
242    printf("load,detail\n");
243 }
244
245 static void
246 my_map_loaded_detail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
247 {
248    printf("loaded,detail\n");
249 }
250
251 static void
252 my_map_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
253 {
254    printf("zoom,start\n");
255 }
256
257 static void
258 my_map_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
259 {
260    printf("zoom,stop\n");
261 }
262
263 static void
264 my_map_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
265 {
266    printf("zoom,change\n");
267 }
268
269 static void
270 my_map_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
271 =======
272 _map_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
273 {
274    printf("press\n");
275 }
276
277 static void
278 _map_longpressed(void *data __UNUSED__, Evas_Object *obj, void *event_info)
279 {
280    if (!event_info) return;
281    double lon, lat;
282    Evas_Event_Mouse_Down *down = (Evas_Event_Mouse_Down *)event_info;
283    elm_map_canvas_to_region_convert(obj, down->canvas.x, down->canvas.y, &lon, &lat);
284    printf("longpressed, x:%d, y:%d, lon:%lf, lat:%lf\n", down->canvas.x, down->canvas.y, lon, lat);
285
286    if (elm_map_zoom_get(obj) < 8) return;
287    if (name) elm_map_name_del(name);
288    name = elm_map_name_add(obj, NULL, lon, lat, NULL, NULL);
289 }
290
291 static void
292 _map_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
293 {
294    double lon, lat;
295    elm_map_region_get(obj, &lon, &lat);
296    printf("scroll, longitude: %f latitude: %f\n", lon, lat);
297 }
298
299 static void
300 _map_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
301 {
302    printf("scroll,drag,start\n");
303    evas_object_smart_callback_del(data, "longpressed", _map_longpressed);
304 }
305
306 static void
307 _map_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
308 {
309    printf("scroll,drag,stop\n");
310    evas_object_smart_callback_add(data, "longpressed", _map_longpressed, data);
311 }
312
313 static void
314 _map_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
315 >>>>>>> remotes/origin/upstream
316 {
317    printf("scroll,anim,start\n");
318 }
319
320 static void
321 <<<<<<< HEAD
322 my_map_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
323 =======
324 _map_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
325 >>>>>>> remotes/origin/upstream
326 {
327    printf("scroll,anim,stop\n");
328 }
329
330 static void
331 <<<<<<< HEAD
332 my_map_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
333 {
334    printf("scroll,drag,start\n");
335    evas_object_smart_callback_del(data, "longpressed", my_map_longpressed);
336 }
337
338 static void
339 my_map_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
340 {
341    printf("scroll,drag,stop\n");
342    evas_object_smart_callback_add(data, "longpressed", my_map_longpressed, data);
343 }
344
345 static void
346 my_map_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
347 {
348    printf("scroll\n");
349    double lon, lat;
350    elm_map_geo_region_get(obj, &lon, &lat);
351    printf("scroll longitude : %f latitude : %f\n", lon, lat);
352 }
353
354 static void
355 my_map_downloaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
356 {
357    int try_num, finish_num;
358    elm_map_utils_downloading_status_get(data, &try_num, &finish_num);
359    printf("downloaded : %d / %d\n", finish_num, try_num);
360 }
361
362 static void
363 my_map_route_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
364 =======
365 _map_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
366 {
367    printf("zoom,start\n");
368 }
369
370 static void
371 _map_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
372 {
373    printf("zoom,stop\n");
374 }
375
376 static void
377 _map_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
378 {
379    printf("zoom,change\n");
380 }
381
382 static void
383 _map_tile_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
384 {
385    printf("tile,load\n");
386 }
387
388 static void
389 _map_tile_loaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
390 {
391    int try_num, finish_num;
392    elm_map_tile_load_status_get(data, &try_num, &finish_num);
393    printf("tile,loaded: %d / %d\n", finish_num, try_num);
394 }
395
396 static void
397 _map_tile_loaded_fail(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
398 {
399    int try_num, finish_num;
400    elm_map_tile_load_status_get(data, &try_num, &finish_num);
401    printf("tile,loaded,fail: %d / %d\n", finish_num, try_num);
402 }
403
404 static void
405 _map_route_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
406 >>>>>>> remotes/origin/upstream
407 {
408    printf("route,load\n");
409 }
410
411 static void
412 <<<<<<< HEAD
413 my_map_route_loaded(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
414 =======
415 _map_route_loaded(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
416 >>>>>>> remotes/origin/upstream
417 {
418    printf("route,loaded\n");
419    double d;
420    const char *w, *n;
421 <<<<<<< HEAD
422 =======
423
424 >>>>>>> remotes/origin/upstream
425    d = elm_map_route_distance_get(route);
426    printf("route distance = %lf km\n", d);
427
428    w = elm_map_route_waypoint_get(route);
429    if (w) printf("[waypoints]\n%s\n", w);
430
431    n = elm_map_route_node_get(route);
432    if (n) printf("[nodes]\n%s\n", n);
433 <<<<<<< HEAD
434 }
435
436 static void
437 my_map_name_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
438 =======
439
440    if (route_ovl) elm_map_overlay_del(route_ovl);
441    route_ovl = elm_map_overlay_route_add(obj, route);
442    elm_map_overlay_color_set(route_ovl, 255, 0, 0, 255);
443 }
444
445 static void
446 _map_route_loaded_fail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
447 {
448    printf("route,loaded,fail\n");
449 }
450
451 static void
452 _map_name_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
453 >>>>>>> remotes/origin/upstream
454 {
455    printf("name,load\n");
456 }
457
458 static void
459 <<<<<<< HEAD
460 my_map_name_loaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
461 =======
462 _map_name_loaded(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
463 >>>>>>> remotes/origin/upstream
464 {
465    printf("name,loaded\n");
466    if (!name) return;
467    double lon, lat;
468    const char *addr = elm_map_name_address_get(name);
469    elm_map_name_region_get(name, &lon, &lat);
470    if (addr)
471      {
472         printf("name of [lon = %lf, lat = %lf] is %s\n", lon, lat, addr);
473         if ((lon != 0.0) && (lat !=0.0))
474           {
475              Eina_Bool b = elm_map_paused_get(data);
476              elm_map_paused_set(data, EINA_TRUE);
477              elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
478 <<<<<<< HEAD
479              elm_map_geo_region_show(data, lon, lat);
480              elm_map_zoom_set(data, elm_map_source_zoom_max_get(data));
481              elm_map_paused_set(data, b);
482           }
483      }
484    elm_map_name_remove(name);
485 =======
486              elm_map_zoom_set(data, elm_map_zoom_max_get(data));
487              elm_map_region_show(data, lon, lat);
488              elm_map_paused_set(data, b);
489           }
490      }
491
492    elm_map_name_del(name);
493    name = NULL;
494 }
495
496 static void
497 _map_name_loaded_fail(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
498 {
499    printf("name,loaded,fail\n");
500 >>>>>>> remotes/origin/upstream
501 }
502
503 static void
504 map_show_urmatt(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
505 {
506    Eina_Bool b = elm_map_paused_get(data);
507    elm_map_paused_set(data, EINA_TRUE);
508    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
509 <<<<<<< HEAD
510    elm_map_geo_region_show(data,7.325201, 48.526813);
511 =======
512    elm_map_region_show(data,7.325201, 48.526813);
513 >>>>>>> remotes/origin/upstream
514    elm_map_zoom_set(data, 12);
515    elm_map_paused_set(data, b);
516 }
517
518 static void
519 map_bring_seoul(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
520 {
521 <<<<<<< HEAD
522    elm_map_geo_region_bring_in(data, 126.977969, 37.566535);
523 =======
524    elm_map_region_bring_in(data, 126.977969, 37.566535);
525 >>>>>>> remotes/origin/upstream
526 }
527
528 static void
529 map_paused_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
530 {
531    elm_map_paused_set(data, EINA_TRUE);
532 }
533
534 static void
535 map_paused_unset(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
536 {
537    elm_map_paused_set(data, EINA_FALSE);
538 }
539
540 static void
541 map_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
542 {
543    int zoom;
544
545    zoom = elm_map_zoom_get(data) + 1;
546    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
547    elm_map_zoom_set(data, zoom);
548 }
549
550 static void
551 map_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
552 {
553    int zoom;
554
555    zoom = elm_map_zoom_get(data) - 1;
556    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_MANUAL);
557    elm_map_zoom_set(data, zoom);
558 }
559
560 static void
561 map_zoom_fit(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
562 {
563    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FIT);
564 }
565
566 static void
567 map_zoom_fill(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
568 {
569    elm_map_zoom_mode_set(data, ELM_MAP_ZOOM_MODE_AUTO_FILL);
570 }
571
572 static void
573 map_track_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
574 {
575    Evas_Object *fs, *bg, *vbox, *hbox, *sep;
576    char *path = NULL;
577
578    fs_win = elm_win_add(NULL, "fileselector", ELM_WIN_BASIC);
579    elm_win_title_set(fs_win, "File Selector");
580    elm_win_autodel_set(fs_win, 1);
581
582    bg = elm_bg_add(fs_win);
583    elm_win_resize_object_add(fs_win, bg);
584    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
585    evas_object_show(bg);
586
587    vbox = elm_box_add(fs_win);
588    elm_win_resize_object_add(fs_win, vbox);
589    evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
590    evas_object_show(vbox);
591
592    fs = elm_fileselector_add(fs_win);
593    elm_fileselector_is_save_set(fs, EINA_TRUE);
594    elm_fileselector_expandable_set(fs, EINA_FALSE);
595    path = getenv("HOME");
596    //if "HOME" is not available, set current dir. path
597    if (!path)
598      path = ".";
599    elm_fileselector_path_set(fs, path);
600    evas_object_size_hint_weight_set(fs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
601    evas_object_size_hint_align_set(fs, EVAS_HINT_FILL, EVAS_HINT_FILL);
602    elm_box_pack_end(vbox, fs);
603    evas_object_show(fs);
604
605    evas_object_smart_callback_add(fs, "done", my_map_gpx_fileselector_done, data);
606
607    sep = elm_separator_add(fs_win);
608    elm_separator_horizontal_set(sep, EINA_TRUE);
609    elm_box_pack_end(vbox, sep);
610    evas_object_show(sep);
611
612    hbox = elm_box_add(fs_win);
613    elm_box_horizontal_set(hbox, EINA_TRUE);
614    elm_box_pack_end(vbox, hbox);
615    evas_object_show(hbox);
616
617    evas_object_resize(fs_win, 240, 350);
618    evas_object_show(fs_win);
619 }
620
621
622 static void
623 map_track_remove(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
624 {
625    elm_map_track_remove(data, track);
626 }
627
628 static void
629 map_rotate_cw(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
630 {
631    double d;
632    Evas_Coord x, y, w, h;
633    float half_w, half_h;
634    evas_object_geometry_get(data, &x, &y, &w, &h);
635    half_w = (float)w * 0.5;
636    half_h = (float)h * 0.5;
637
638    elm_map_rotate_get(data, &d, NULL, NULL);
639    d += 15.0;
640    elm_map_rotate_set(data, d, x + half_w, y + half_h);
641 }
642
643 static void
644 map_rotate_ccw(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
645 {
646    double d;
647    Evas_Coord x, y, w, h;
648    float half_w, half_h;
649    evas_object_geometry_get(data, &x, &y, &w, &h);
650    half_w = (float)w * 0.5;
651    half_h = (float)h * 0.5;
652
653    elm_map_rotate_get(data, &d, NULL, NULL);
654    d -= 15.0;
655    elm_map_rotate_set(data, d, x + half_w, y + half_h);
656 }
657
658 static void
659 map_rotate_reset(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
660 {
661    Evas_Coord x, y, w, h;
662    float half_w, half_h;
663    evas_object_geometry_get(data, &x, &y, &w, &h);
664    half_w = (float)w * 0.5;
665    half_h = (float)h * 0.5;
666
667    elm_map_rotate_set(data, 0.0, x + half_w, y + half_h);
668 }
669
670 static void
671 map_zoom_min_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
672 {
673 <<<<<<< HEAD
674    elm_map_source_zoom_min_set(data, 1);
675 =======
676    elm_map_zoom_min_set(data, 1);
677 >>>>>>> remotes/origin/upstream
678 }
679
680 static void
681 map_zoom_max_set(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
682 {
683 <<<<<<< HEAD
684    elm_map_source_zoom_max_set(data, 10);
685 =======
686    elm_map_zoom_max_set(data, 10);
687 >>>>>>> remotes/origin/upstream
688 }
689
690 static void
691 map_source(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
692 {
693    Map_Source *s = data;
694
695    if (!s) return;
696 <<<<<<< HEAD
697    elm_map_source_name_set(s->map, s->source_name);
698 =======
699    elm_map_source_set(s->map, ELM_MAP_SOURCE_TYPE_TILE, s->source_name);
700 >>>>>>> remotes/origin/upstream
701 }
702
703 /*
704 static void
705 map_marker_add(void *data)
706 {
707    int i;
708    Elm_Map_Group_Class *g_clas;
709    Elm_Map_Marker_Class *m_clas;
710 <<<<<<< HEAD
711    Marker_Data *d = &data7;
712 =======
713    Overlay_Data *d = &data7;
714 >>>>>>> remotes/origin/upstream
715
716    if (*markers) return;
717    for (i =0; i<MARKER_MAX; i++)
718      {
719         d = &data7;
720
721         int r1 = rand() % (180*2*100);
722         if (r1<=180) r1 = -r1;
723         else r1 = r1 - 180*100;
724
725         int r2 = rand() % (85*2*100);
726         if (r2<=85) r2 = -r2;
727         else r2 = r2 - 85*100;
728
729         int style = rand() % 3;
730         if (!style) m_clas = itc1;
731         else if (style == 1) m_clas = itc2;
732         else
733           {
734              m_clas = itc_parking;
735 <<<<<<< HEAD
736              d = &data_parking;
737 =======
738              d = &parking;
739 >>>>>>> remotes/origin/upstream
740           }
741
742         style = rand() % 2;
743         if (!style) g_clas = itc_group1;
744         else g_clas = itc_group2;
745
746         markers[i] = elm_map_marker_add(data, r1/100., r2/100., m_clas, g_clas, d);
747      }
748    nb_elts += 1000;
749    printf("nb elements: %d\n", nb_elts);
750 }
751
752 static void
753 map_marker_remove(void *data __UNUSED__)
754 {
755    int i;
756
757    for (i = 0; i<MARKER_MAX; i++)
758      {
759         if (markers[i])
760           {
761              elm_map_marker_remove(markers[i]);
762              markers[i] = NULL;
763           }
764      }
765 }
766
767 static void
768 my_map_entry_focused(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
769 {
770    const char *s = elm_scrolled_entry_entry_get(obj);
771    if (!strcmp(s, NAME_ENTRY_TEXT)) elm_scrolled_entry_entry_set(obj, "");
772 }
773
774 static void
775 my_map_entry_activated(void *data, Evas_Object *obj, void *event_info __UNUSED__)
776 {
777    const char *s = elm_scrolled_entry_entry_get(obj);
778    char *addr = strdup(s);
779    name = elm_map_utils_convert_name_into_coord(data, addr);
780    if (addr) free (addr);
781 }
782 */
783
784 static Evas_Object *
785 <<<<<<< HEAD
786 _marker_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data)
787 {
788    Marker_Data *d = data;
789
790    Evas_Object *bx = elm_box_add(obj);
791    evas_object_show(bx);
792
793    if (d == &data3)
794      {
795         Evas_Object *icon = elm_icon_add(obj);
796         elm_icon_file_set(icon, d->file, NULL);
797         evas_object_show(icon);
798
799         Evas_Object *o = elm_button_add(obj);
800         elm_object_part_content_set(o, "icon", icon);
801         evas_object_show(o);
802         elm_box_pack_end(bx, o);
803      }
804    else
805      {
806         Evas_Object *o = evas_object_image_add(evas_object_evas_get(obj));
807         evas_object_image_file_set(o, d->file, NULL);
808         evas_object_image_filled_set(o, EINA_TRUE);
809         evas_object_size_hint_min_set(o, 64, 64);
810         evas_object_show(o);
811         elm_box_pack_end(bx, o);
812
813         Evas_Object *lbl = elm_label_add(obj);
814         elm_object_text_set(lbl, "Wolves Go !");
815         evas_object_show(lbl);
816         elm_box_pack_end(bx, lbl);
817      }
818
819 =======
820 _box_get(Evas_Object *obj, Overlay_Data *data)
821 {
822    Evas_Object *bx, *img, *label;
823    bx = elm_box_add(obj);
824    evas_object_show(bx);
825
826    img = evas_object_image_add(evas_object_evas_get(obj));
827    evas_object_image_file_set(img, data->file, NULL);
828    evas_object_image_filled_set(img, EINA_TRUE);
829    evas_object_size_hint_min_set(img, 64, 64);
830    evas_object_show(img);
831    elm_box_pack_end(bx, img);
832
833    label = elm_label_add(obj);
834    elm_object_text_set(label, "Wolves go!!");
835    evas_object_show(label);
836    elm_box_pack_end(bx, label);
837 >>>>>>> remotes/origin/upstream
838    return bx;
839 }
840
841 static Evas_Object *
842 <<<<<<< HEAD
843 _icon_get(Evas_Object *obj, Elm_Map_Marker *marker __UNUSED__, void *data)
844 {
845    Marker_Data *d = data;
846
847    Evas_Object *icon = elm_icon_add(obj);
848    elm_icon_file_set(icon, d->file, NULL);
849    evas_object_show(icon);
850
851    return icon;
852 }
853
854 static Evas_Object *
855 _group_icon_get(Evas_Object *obj, void *data)
856 {
857    char *file = data;
858
859    Evas_Object *icon = elm_icon_add(obj);
860    elm_icon_file_set(icon, file, NULL);
861 =======
862 _icon_get(Evas_Object *obj, Overlay_Data *data)
863 {
864    Evas_Object *icon = elm_icon_add(obj);
865    elm_icon_file_set(icon, data->file, NULL);
866 >>>>>>> remotes/origin/upstream
867    evas_object_show(icon);
868
869    return icon;
870 }
871
872 static void
873 <<<<<<< HEAD
874 _map_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
875 {
876    int x,y,w,h;
877
878    evas_object_geometry_get(data,&x,&y,&w,&h);
879    evas_object_resize(rect,w,h);
880    evas_object_move(rect,x,y);
881 }
882
883 static void
884 =======
885 >>>>>>> remotes/origin/upstream
886 _populate(void *data, Elm_Object_Item *menu_it)
887 {
888    int idx;
889
890    if ((!data) || (!menu_it) || (!source_names)) return;
891    for (idx = 0; source_names[idx]; idx++)
892      {
893         if (idx >= SOURCE_MAX) break;
894         ms[idx].map = data;
895         ms[idx].source_name = strdup(source_names[idx]);
896         elm_menu_item_add(menu, menu_it, "", source_names[idx], map_source,
897                           &ms[idx]);
898      }
899 }
900
901 static void
902 _map_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info)
903 {
904    Evas_Event_Mouse_Down *down = event_info;
905    Elm_Object_Item *menu_it;
906    if (!down) return;
907
908    if (down->button == 2)
909      {
910         old_x = down->canvas.x;
911         old_y = down->canvas.y;
912         old_d = 0.0;
913      }
914    else if (down->button == 3)
915      {
916         menu = elm_menu_add(obj);
917         menu_it = elm_menu_item_add(menu, NULL, NULL, "Source", NULL, NULL);
918         _populate(data, menu_it);
919         elm_menu_item_add(menu, NULL, NULL, "Show Urmatt", map_show_urmatt, data);
920         elm_menu_item_add(menu, NULL, NULL, "Bring Seoul", map_bring_seoul, data);
921         elm_menu_item_add(menu, NULL, NULL, "Paused Set", map_paused_set, data);
922         elm_menu_item_add(menu, NULL, NULL, "Paused Unset", map_paused_unset, data);
923         elm_menu_item_add(menu, NULL, NULL, "Zoom +", map_zoom_in, data);
924         elm_menu_item_add(menu, NULL, NULL, "Zoom -", map_zoom_out, data);
925         elm_menu_item_add(menu, NULL, NULL, "Zoom Fit", map_zoom_fit, data);
926         elm_menu_item_add(menu, NULL, NULL, "Zoom Fill", map_zoom_fill, data);
927         elm_menu_item_add(menu, NULL, NULL, "Add Track", map_track_add, data);
928         elm_menu_item_add(menu, NULL, NULL, "Remove Track", map_track_remove, data);
929         elm_menu_item_add(menu, NULL, NULL, "Add Marker", NULL, NULL);
930         elm_menu_item_add(menu, NULL, NULL, "Rotate CW", map_rotate_cw, data);
931         elm_menu_item_add(menu, NULL, NULL, "Rotate CCW", map_rotate_ccw, data);
932         elm_menu_item_add(menu, NULL, NULL, "Reset Rotate", map_rotate_reset, data);
933         elm_menu_item_add(menu, NULL, NULL, "Set Zoom Min to 1", map_zoom_min_set, data);
934         elm_menu_item_add(menu, NULL, NULL, "Set Zoom Max to 10", map_zoom_max_set, data);
935
936         elm_menu_move(menu, down->canvas.x, down->canvas.y);
937         evas_object_show(menu);
938      }
939 }
940
941 static void
942 _map_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
943 {
944    Evas_Event_Mouse_Move *move = event_info;
945    Evas_Coord x, y, w, h;
946    float half_w, half_h;
947    int d, d_diff;
948    double cur_d;
949    if (!move) return;
950
951    if (move->buttons == 2)
952      {
953         evas_object_geometry_get(data, &x, &y, &w, &h);
954         half_w = (float)w * 0.5;
955         half_h = (float)h * 0.5;
956         elm_map_rotate_get(data, &cur_d, NULL, NULL);
957
958         d = move->cur.canvas.x - old_x;
959         if (!old_d) old_d = d;
960         else
961           {
962              d_diff = old_d - d;
963              if (d_diff > 0)
964                {
965                   old_d --;
966                   cur_d += 1.0;
967                }
968              else if (d_diff < 0)
969                {
970                   old_d ++;
971                   cur_d -= 1.0;
972                }
973              old_d = d;
974              elm_map_rotate_set(data, cur_d, x + half_w, y + half_h);
975           }
976      }
977 }
978
979 static void
980 _map_mouse_up(void *data __UNUSED__, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
981 {
982    Evas_Event_Mouse_Up *up = event_info;
983    if (!up) return;
984
985    if (up->button == 2)
986      {
987         old_x = 0;
988         old_y = 0;
989      }
990 }
991
992 <<<<<<< HEAD
993 =======
994 static void
995 _overlay_cb(void *data __UNUSED__, Evas_Object *map, void *ev)
996 {
997    printf("Overlay clicked: ");
998    Elm_Map_Overlay *overlay = ev;
999    Evas_Object *bx;
1000
1001    Overlay_Data *od = elm_map_overlay_data_get(overlay);
1002    if (!od)
1003      {
1004         printf("No overlay data\n");
1005      }
1006    else if (elm_map_overlay_type_get(overlay) == ELM_MAP_OVERLAY_TYPE_DEFAULT)
1007      {
1008         // prevent duplication
1009         if (!bubble_img)  bubble_img = elm_map_overlay_bubble_add(map);
1010
1011         elm_map_overlay_bubble_follow(bubble_img, overlay);
1012         bx = _box_get(map, od);
1013         elm_map_overlay_bubble_content_clear(bubble_img);
1014         elm_map_overlay_bubble_content_append(bubble_img, bx);
1015         printf("overlay rendered\n");
1016      }
1017    else printf("not default type\n");
1018 }
1019
1020 static void
1021 _parking_cb(void *data __UNUSED__, Evas_Object *map, const Elm_Map_Overlay *ovl)
1022 {
1023    if (elm_map_overlay_type_get(ovl) != ELM_MAP_OVERLAY_TYPE_DEFAULT) return;
1024
1025    double lon, lat;
1026    Evas_Coord x, y;
1027    elm_map_overlay_region_get(ovl, &lon, &lat);
1028    elm_map_region_to_canvas_convert(map, lon, lat, &x, &y);
1029    printf("Parking clicked: %lf %lf %d %d\n", lon, lat, x, y);
1030
1031    if (!bubble_parking)
1032      {
1033         Evas_Object *bubble, *label;
1034         bubble = elm_bubble_add(map);
1035         elm_bubble_pos_set(bubble, ELM_BUBBLE_POS_BOTTOM_LEFT);
1036         elm_object_text_set(bubble, "Overlay object");
1037         elm_object_part_text_set(bubble, "info", "Bubble is overlayed");
1038
1039         label = elm_label_add(bubble);
1040         elm_object_text_set(label, "Parking Here !!");
1041         evas_object_show(label);
1042         elm_object_content_set(bubble, label);
1043
1044         evas_object_resize(bubble, 125, 50);
1045         evas_object_show(bubble);
1046
1047         bubble_parking = elm_map_overlay_add(map, lon + 0.0006, lat + 0.0006);
1048         elm_map_overlay_content_set(bubble_parking, bubble);
1049      }
1050    elm_map_overlay_region_set(bubble_parking, lon + 0.0006, lat + 0.0006);
1051 }
1052
1053 static void
1054 _del_map(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ei __UNUSED__)
1055 {
1056    if (route_start)    elm_map_overlay_del(route_start);
1057    if (route_end)      elm_map_overlay_del(route_end);
1058    if (route_clas)     elm_map_overlay_del(route_clas);
1059    if (bubble_img)     elm_map_overlay_del(bubble_img);
1060    if (bubble_parking) elm_map_overlay_del(bubble_parking);
1061    if (route_ovl)      elm_map_overlay_del(route_ovl);
1062    route_start = NULL;
1063    route_end = NULL;
1064    route_clas = NULL;
1065    bubble_img = NULL;
1066    bubble_parking = NULL;
1067    route_ovl = NULL;
1068
1069    if (route) elm_map_route_del(route);
1070    if (name) elm_map_name_del(name);
1071    route = NULL;
1072    name = NULL;
1073 }
1074
1075 >>>>>>> remotes/origin/upstream
1076 void
1077 test_map(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
1078 {
1079    Evas_Object *win, *bg, *map;
1080    int idx = 0;
1081
1082    win = elm_win_add(NULL, "map", ELM_WIN_BASIC);
1083    elm_win_title_set(win, "Map");
1084    elm_win_autodel_set(win, EINA_TRUE);
1085
1086    bg = elm_bg_add(win);
1087    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1088    elm_win_resize_object_add(win, bg);
1089    evas_object_show(bg);
1090
1091    map = elm_map_add(win);
1092    if (map)
1093      {
1094 <<<<<<< HEAD
1095         srand(time(NULL));
1096
1097         source_names = elm_map_source_names_get(map);
1098
1099         if (!source_names) return;
1100         printf("map sources [ ");
1101         for (idx = 0; source_names[idx] ; idx++) printf("%s ", source_names[idx]);
1102 =======
1103         Elm_Map_Overlay *ovl_1, *ovl_2, *ovl_3, *ovl_4, *ovl_5, *ovl6;
1104         Elm_Map_Overlay *ovl_7, *ovl_8, *ovl_9, *ovl_10, *ovl_11;
1105         Elm_Map_Overlay *parking1, *parking2, *parking3, *parking4, *parking5;
1106         Elm_Map_Overlay *grp1, *grp2, *grp_parking;
1107
1108         evas_object_event_callback_add(map, EVAS_CALLBACK_DEL, _del_map, NULL);
1109
1110         srand(time(NULL));
1111
1112         source_names = elm_map_sources_get(map, ELM_MAP_SOURCE_TYPE_TILE);
1113
1114         if (!source_names) return;
1115         printf("map sources [ ");
1116         for (idx = 0; source_names[idx] ; idx++) printf("%s, ", source_names[idx]);
1117 >>>>>>> remotes/origin/upstream
1118         printf("]\n");
1119
1120         evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1121         elm_win_resize_object_add(win, map);
1122         evas_object_data_set(map, "window", win);
1123
1124 <<<<<<< HEAD
1125         //
1126         itc1 = elm_map_marker_class_new(map);
1127         elm_map_marker_class_get_cb_set(itc1, _marker_get);
1128         elm_map_marker_class_del_cb_set(itc1, NULL);
1129
1130         itc2 = elm_map_marker_class_new(map);
1131         elm_map_marker_class_get_cb_set(itc2, _marker_get);
1132         elm_map_marker_class_del_cb_set(itc2, NULL);
1133         elm_map_marker_class_style_set(itc2, "radio2");
1134
1135         itc_parking = elm_map_marker_class_new(map);
1136         elm_map_marker_class_get_cb_set(itc_parking, _marker_get);
1137         elm_map_marker_class_del_cb_set(itc_parking, NULL);
1138         elm_map_marker_class_icon_cb_set(itc_parking, _icon_get);
1139         elm_map_marker_class_style_set(itc_parking, "empty");
1140         //
1141
1142         //
1143         itc_group1 = elm_map_group_class_new(map);
1144         elm_map_group_class_data_set(itc_group1, (void *)PACKAGE_DATA_DIR"/images/plant_01.jpg");
1145
1146         itc_group2 = elm_map_group_class_new(map);
1147         elm_map_group_class_style_set(itc_group2, "radio2");
1148         elm_map_group_class_zoom_displayed_set(itc_group1, 3);
1149
1150         itc_group_parking = elm_map_group_class_new(map);
1151         elm_map_group_class_icon_cb_set(itc_group_parking, _group_icon_get);
1152         elm_map_group_class_data_set(itc_group_parking, (void *)PACKAGE_DATA_DIR"/images/parking.png");
1153         elm_map_group_class_style_set(itc_group_parking, "empty");
1154         elm_map_group_class_zoom_displayed_set(itc_group_parking, 5);
1155         //
1156
1157         rect = evas_object_rectangle_add(evas_object_evas_get(win));
1158         evas_object_color_set(rect, 0, 0, 0, 0);
1159         evas_object_repeat_events_set(rect,1);
1160         evas_object_show(rect);
1161         evas_object_raise(rect);
1162
1163         evas_object_event_callback_add(map, EVAS_CALLBACK_RESIZE,
1164                                        _map_move_resize_cb, map);
1165         evas_object_event_callback_add(map, EVAS_CALLBACK_MOVE,
1166                                        _map_move_resize_cb, map);
1167 =======
1168 >>>>>>> remotes/origin/upstream
1169         evas_object_event_callback_add(map, EVAS_CALLBACK_MOUSE_DOWN,
1170                                        _map_mouse_down, map);
1171         evas_object_event_callback_add(map, EVAS_CALLBACK_MOUSE_MOVE,
1172                                        _map_mouse_move, map);
1173         evas_object_event_callback_add(map, EVAS_CALLBACK_MOUSE_UP,
1174                                        _map_mouse_up, map);
1175
1176 <<<<<<< HEAD
1177         elm_map_marker_add(map, 2.352, 48.857, itc1, itc_group1, &data1);
1178         elm_map_marker_add(map, 2.355, 48.857, itc1, itc_group1, &data3);
1179         elm_map_marker_add(map, 3, 48.857, itc2, itc_group1, &data2);
1180         elm_map_marker_add(map, 2.352, 49, itc2, itc_group1, &data1);
1181
1182         elm_map_marker_add(map, 7.31451, 48.857127, itc1, itc_group1, &data10);
1183         elm_map_marker_add(map, 7.314704, 48.857119, itc1, itc_group1, &data4);
1184         elm_map_marker_add(map, 7.314704, 48.857119, itc2, itc_group1, &data5);
1185         elm_map_marker_add(map, 7.31432, 48.856785, itc2, itc_group1, &data6);
1186         elm_map_marker_add(map, 7.3148, 48.85725, itc1, itc_group2, &data7);
1187         elm_map_marker_add(map, 7.316445, 48.8572210000694, itc1, itc_group1, &data8);
1188         elm_map_marker_add(map, 7.316527000125, 48.85609, itc2, itc_group2, &data9);
1189         elm_map_marker_add(map, 7.3165409990833, 48.856078, itc2, itc_group1, &data11);
1190         elm_map_marker_add(map, 7.319812, 48.856561, itc2, itc_group2, &data10);
1191
1192         nb_elts = 13;
1193
1194         evas_object_smart_callback_add(map, "clicked", my_map_clicked, map);
1195         evas_object_smart_callback_add(map, "press", my_map_press, map);
1196         evas_object_smart_callback_add(map, "longpressed", my_map_longpressed, map);
1197         evas_object_smart_callback_add(map, "clicked,double", my_map_clicked_double, map);
1198         evas_object_smart_callback_add(map, "load,detail", my_map_load_detail, map);
1199         evas_object_smart_callback_add(map, "loaded,detail", my_map_loaded_detail, map);
1200         evas_object_smart_callback_add(map, "zoom,start", my_map_zoom_start, map);
1201         evas_object_smart_callback_add(map, "zoom,stop", my_map_zoom_stop, map);
1202         evas_object_smart_callback_add(map, "zoom,change", my_map_zoom_change, map);
1203         evas_object_smart_callback_add(map, "scroll,anim,start", my_map_anim_start, map);
1204         evas_object_smart_callback_add(map, "scroll,anim,stop", my_map_anim_stop, map);
1205         evas_object_smart_callback_add(map, "scroll,drag,start", my_map_drag_start, map);
1206         evas_object_smart_callback_add(map, "scroll,drag,stop", my_map_drag_stop, map);
1207         evas_object_smart_callback_add(map, "scroll", my_map_scroll, map);
1208         evas_object_smart_callback_add(map, "downloaded", my_map_downloaded, map);
1209         evas_object_smart_callback_add(map, "route,load", my_map_route_load, map);
1210         evas_object_smart_callback_add(map, "route,loaded", my_map_route_loaded, map);
1211         evas_object_smart_callback_add(map, "name,load", my_map_name_load, map);
1212         evas_object_smart_callback_add(map, "name,loaded", my_map_name_loaded, map);
1213 =======
1214         evas_object_smart_callback_add(map, "clicked", _map_clicked, map);
1215         evas_object_smart_callback_add(map, "clicked,double", _map_clicked_double, map);
1216         evas_object_smart_callback_add(map, "press", _map_press, map);
1217         evas_object_smart_callback_add(map, "longpressed", _map_longpressed, map);
1218         evas_object_smart_callback_add(map, "scroll", _map_scroll, map);
1219         evas_object_smart_callback_add(map, "scroll,drag,start", _map_drag_start, map);
1220         evas_object_smart_callback_add(map, "scroll,drag,stop", _map_drag_stop, map);
1221         evas_object_smart_callback_add(map, "scroll,anim,start", _map_anim_start, map);
1222         evas_object_smart_callback_add(map, "scroll,anim,stop", _map_anim_stop, map);
1223         evas_object_smart_callback_add(map, "zoom,start", _map_zoom_start, map);
1224         evas_object_smart_callback_add(map, "zoom,stop", _map_zoom_stop, map);
1225         evas_object_smart_callback_add(map, "zoom,change", _map_zoom_change, map);
1226         evas_object_smart_callback_add(map, "tile,load", _map_tile_load, map);
1227         evas_object_smart_callback_add(map, "tile,loaded", _map_tile_loaded, map);
1228         evas_object_smart_callback_add(map, "tile,loaded,fail", _map_tile_loaded_fail, map);
1229         evas_object_smart_callback_add(map, "route,load", _map_route_load, map);
1230         evas_object_smart_callback_add(map, "route,loaded", _map_route_loaded, map);
1231         evas_object_smart_callback_add(map, "route,loaded,fail", _map_route_loaded_fail, map);
1232         evas_object_smart_callback_add(map, "name,load", _map_name_load, map);
1233         evas_object_smart_callback_add(map, "name,loaded", _map_name_loaded, map);
1234         evas_object_smart_callback_add(map, "name,loaded,fail", _map_name_loaded_fail, map);
1235         evas_object_smart_callback_add(map, "overlay,clicked", _overlay_cb, map);
1236
1237         // Create Overlays
1238         ovl_1 = elm_map_overlay_add(map, 2.352, 48.857);
1239         ovl_2 = elm_map_overlay_add(map, 3, 48.857);
1240         ovl_3 = elm_map_overlay_add(map, 2.352, 49);
1241         ovl_4 = elm_map_overlay_add(map, 7.31451, 48.857127);
1242         ovl_5 = elm_map_overlay_add(map, 7.314704, 48.857119);
1243         ovl6 = elm_map_overlay_add(map, 7.31432, 48.856785);
1244         ovl_7 = elm_map_overlay_add(map, 7.3148, 48.85725);
1245         ovl_8 = elm_map_overlay_add(map, 7.316445, 48.8572210000694);
1246         ovl_9 = elm_map_overlay_add(map, 7.316527000125, 48.85609);
1247         ovl_10 = elm_map_overlay_add(map, 7.3165409990833, 48.856078);
1248         ovl_11 = elm_map_overlay_add(map, 7.319812, 48.856561);
1249         elm_map_overlay_data_set(ovl_1, &data1);
1250         elm_map_overlay_data_set(ovl_2, &data2);
1251         elm_map_overlay_data_set(ovl_3, &data3);
1252         elm_map_overlay_data_set(ovl_4, &data4);
1253         elm_map_overlay_data_set(ovl_5, &data5);
1254         elm_map_overlay_data_set(ovl6, &data6);
1255         elm_map_overlay_data_set(ovl_7, &data7);
1256         elm_map_overlay_data_set(ovl_8, &data8);
1257         elm_map_overlay_data_set(ovl_9, &data9);
1258         elm_map_overlay_data_set(ovl_10, &data10);
1259         elm_map_overlay_data_set(ovl_11, &data11);
1260
1261         // Append overlays to groups
1262         grp1 = elm_map_overlay_class_add(map);
1263         elm_map_overlay_displayed_zoom_min_set(grp1, 3);
1264         elm_map_overlay_class_append(grp1, ovl_1);
1265         elm_map_overlay_class_append(grp1, ovl_2);
1266         elm_map_overlay_class_append(grp1, ovl_3);
1267         elm_map_overlay_class_append(grp1, ovl_4);
1268         elm_map_overlay_class_append(grp1, ovl_5);
1269         elm_map_overlay_class_append(grp1, ovl6);
1270         evas_object_smart_callback_add(map, "overlay,clicked", _overlay_cb, map);
1271
1272         // Append overlays to groups
1273         grp2 = elm_map_overlay_class_add(map);
1274         elm_map_overlay_class_append(grp2, ovl_7);
1275         elm_map_overlay_class_append(grp2, ovl_8);
1276         elm_map_overlay_class_append(grp2, ovl_9);
1277         elm_map_overlay_class_append(grp2, ovl_10);
1278         elm_map_overlay_class_append(grp2, ovl_11);
1279
1280         // Create overlays
1281         parking1 = elm_map_overlay_add(map, 127.04871, 37.25730);
1282         parking2 = elm_map_overlay_add(map, 127.05578, 37.25545);
1283         parking3 = elm_map_overlay_add(map, 127.05515, 37.25439);
1284         parking4 = elm_map_overlay_add(map, 127.05328, 37.25721);
1285         parking5 = elm_map_overlay_add(map, 127.05431, 37.25873);
1286         elm_map_overlay_icon_set(parking4, _icon_get(map, &icon_data));
1287         elm_map_overlay_get_cb_set(parking1, _parking_cb, NULL);
1288         elm_map_overlay_get_cb_set(parking2, _parking_cb, NULL);
1289         elm_map_overlay_get_cb_set(parking3, _parking_cb, NULL);
1290         elm_map_overlay_get_cb_set(parking4, _parking_cb, NULL);
1291         elm_map_overlay_get_cb_set(parking5, _parking_cb, NULL);
1292
1293         // Append overlays to groups
1294         grp_parking = elm_map_overlay_class_add(map);
1295         elm_map_overlay_icon_set(grp_parking, _icon_get(map, &parking));
1296         elm_map_overlay_class_append(grp_parking, parking1);
1297         elm_map_overlay_class_append(grp_parking, parking2);
1298         elm_map_overlay_class_append(grp_parking, parking3);
1299         elm_map_overlay_class_append(grp_parking, parking4);
1300         elm_map_overlay_class_append(grp_parking, parking5);
1301 >>>>>>> remotes/origin/upstream
1302
1303         evas_object_show(map);
1304      }
1305
1306    evas_object_resize(win, 800, 800);
1307    evas_object_show(win);
1308 }
1309 #endif