This code places an Elementary map widget on a window, to exemplify part of the widget\textquotesingle{}s API, related to overlays.

We\textquotesingle{}ll start this example in the same way as \mbox{\hyperlink{map_example_01}{Map Example 1}}. Adding a map with buttons to control zoom, so if you didn\textquotesingle{}t read it yet, just do it now.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   map = \mbox{\hyperlink{group__Elm__Map__Group_ga509621f20872fe3ef3418919f7fda396}{elm\_map\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga2af897b00f32bebf08705929276386f5}{evas\_object\_size\_hint\_weight\_set}}(map, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(map);}
\DoxyCodeLine{}
\DoxyCodeLine{   box = \mbox{\hyperlink{group__Elm__Box__Group_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(box);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"{}+"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(box, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"{}clicked"{}}, \_bt\_zoom\_in, map);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"{}-\/"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(box, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"{}clicked"{}}, \_bt\_zoom\_out, map);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"{}X"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(box, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"{}clicked"{}}, \_bt\_zoom\_fit, map);}
\DoxyCodeLine{}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"{}\#"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(box, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"{}clicked"{}}, \_bt\_zoom\_fill, map);}

\end{DoxyCodeInclude}
 Overlays can be placed over the map to represent anything we want. Let\textquotesingle{}s say we want to represent some countries and cities with overlays.

Before we create city or country overlays, let\textquotesingle{}s create class overlays.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   city\_clas = \mbox{\hyperlink{group__Elm__Map__Group_ga3b0343d426233644e6bba87cb352ee0b}{elm\_map\_overlay\_class\_add}}(map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gab6ec9926a0e290b8513733dea198d0c8}{elm\_map\_overlay\_displayed\_zoom\_min\_set}}(city\_clas, 3);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga1e43a278f16fcf4330c46d68f61fe294}{elm\_map\_overlay\_icon\_set}}(city\_clas, \_clas\_city\_icon\_get(map));}

\end{DoxyCodeInclude}
These lines create a class overlay which represents cities. This class overlay will be used for grouping city overlays. Later city overlays in the same class are appended to this class overlay. if city overlays are near each other, they will be grouped.

We can set the icon for the class so that the icon will be displayed when city overlays are grouped. We can set the zoom required to display the overlays that belongs to this class, so if the zoom is less than this value, nothing will be shown.

Country class can be created in the same way. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   country\_clas = \mbox{\hyperlink{group__Elm__Map__Group_ga3b0343d426233644e6bba87cb352ee0b}{elm\_map\_overlay\_class\_add}}(map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gab6ec9926a0e290b8513733dea198d0c8}{elm\_map\_overlay\_displayed\_zoom\_min\_set}}(country\_clas, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga1e43a278f16fcf4330c46d68f61fe294}{elm\_map\_overlay\_icon\_set}}(country\_clas, \_clas\_country\_icon\_get(map));}

\end{DoxyCodeInclude}
 Next we\textquotesingle{}ll create some overlays representing cities and countries. We set the data for the overlay so that can be used later when clicked callback is called. We\textquotesingle{}ll append them into city class to be grouped. We\textquotesingle{}ll append them in a list, to close up them later. To create a default overlay, we need to pass the coordinates. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   ovl = \mbox{\hyperlink{group__Elm__Map__Group_ga100f0dbec782910bd0f67515a9f39ebb}{elm\_map\_overlay\_add}}(map, -\/43.2, -\/22.9);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga1e43a278f16fcf4330c46d68f61fe294}{elm\_map\_overlay\_icon\_set}}(ovl, \_city\_icon\_get(map));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga0067f7e03f714cee441291c27f00e2f5}{elm\_map\_overlay\_data\_set}}(ovl, \&data\_rio);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga777d9957f6678d76961f60d8c0a5e47a}{elm\_map\_overlay\_class\_append}}(city\_clas, ovl);}
\DoxyCodeLine{   ovls = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(ovls, ovl);}

\end{DoxyCodeInclude}
 We subscribe a smart callback \char`\"{}overlay,clicked\char`\"{} to create bubble on the clicked overlay.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(map, \textcolor{stringliteral}{"{}overlay,clicked"{}}, \_overlay\_cb, NULL);}

\end{DoxyCodeInclude}
 Finally, on our {\ttfamily main} function, we ask the map to show all the overlays with the biggest zoom possible, passing the list of overlays added. 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga9836386af587e54f3b9eb9a4cffb085f}{elm\_map\_overlays\_show}}(ovls);}

\end{DoxyCodeInclude}
 We have created a specific structure for this example to store the name of the place and a path to a image file to represent it.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{keyword}{typedef} \textcolor{keyword}{struct }\_Overlay\_Data}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name;}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file;}
\DoxyCodeLine{\} Overlay\_Data;}

\end{DoxyCodeInclude}
 We\textquotesingle{}ll create instances for each place\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{Overlay\_Data data\_argentina = \{\textcolor{stringliteral}{"{}Argentina"{}}, NULL\};}
\DoxyCodeLine{Overlay\_Data data\_chile = \{\textcolor{stringliteral}{"{}Chile"{}}, NULL\};}
\DoxyCodeLine{Overlay\_Data data\_sampa = \{\textcolor{stringliteral}{"{}São Paulo"{}}, NULL\};}
\DoxyCodeLine{Overlay\_Data data\_rio = \{\textcolor{stringliteral}{"{}Rio de Janeiro"{}}, NULL\};}
\DoxyCodeLine{Overlay\_Data data\_brasilia = \{\textcolor{stringliteral}{"{}Brasília"{}}, NULL\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{struct__Elm__Map__Overlay}{Elm\_Map\_Overlay}} *bubble;}
\DoxyCodeLine{\textcolor{keyword}{const} \textcolor{keywordtype}{char} *data\_dir;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *icon = \mbox{\hyperlink{group__Elm__Icon_ga5739728c1209f90422cf65a778a16502}{elm\_icon\_add}}(obj);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Image_gad1a96ede5f513042cef3c1dac4572f73}{elm\_image\_file\_set}}(icon, file, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(icon);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} icon;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_city\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[256];}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/icon\_07.png"{}}, data\_dir);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \_icon\_get(obj, buf);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_clas\_city\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[256];}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/icon\_05.png"{}}, data\_dir);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \_icon\_get(obj, buf);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_country\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[256];}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/icon\_06.png"{}}, data\_dir);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \_icon\_get(obj, buf);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_clas\_country\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[256];}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/icon\_04.png"{}}, data\_dir);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \_icon\_get(obj, buf);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *}
\DoxyCodeLine{\_box\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj, Overlay\_Data *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bx, *img, *label;}
\DoxyCodeLine{   bx = \mbox{\hyperlink{group__Elm__Box__Group_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(obj);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{   img = \mbox{\hyperlink{group__Evas__Object__Image_gadd901a6b181c38dc040537b3fd76fcc6}{evas\_object\_image\_add}}(\mbox{\hyperlink{group__Evas__Object__Group_gae1058082dae7b97590c41f43405dfdbf}{evas\_object\_evas\_get}}(obj));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(img, data-\/>file, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga26dff9f60428cac5e02bc822b025031a}{evas\_object\_image\_filled\_set}}(img, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga3014f5c9dfbdc6c7af41a27826e50e57}{evas\_object\_size\_hint\_min\_set}}(img, 64, 64);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(img);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, img);}
\DoxyCodeLine{}
\DoxyCodeLine{   label = \mbox{\hyperlink{group__Elm__Label__Group_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(obj);}
\DoxyCodeLine{   elm\_object\_text\_set(label, data-\/>name);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, label);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} bx;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_overlay\_cb(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *map, \textcolor{keywordtype}{void} *ev)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}Overlay clicked\(\backslash\)n"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Elm__Map__Overlay}{Elm\_Map\_Overlay}} *overlay = ev;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bx;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// prevent duplication}}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!bubble)  bubble = \mbox{\hyperlink{group__Elm__Map__Group_gadb9e80c0e108597e24e909c6636f8fbb}{elm\_map\_overlay\_bubble\_add}}(map);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga509d308528ef4e0ee2f67f4513caae79}{elm\_map\_overlay\_bubble\_follow}}(bubble, overlay);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga9f32522cadd9d1aa4e2de0de2190f2ad}{elm\_map\_overlay\_bubble\_content\_clear}}(bubble);}
\DoxyCodeLine{   bx = \_box\_get(map, \mbox{\hyperlink{group__Elm__Map__Group_gab0f5c68371bf38bd54adcf15b02ff774}{elm\_map\_overlay\_data\_get}}(overlay));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga09f6eac5ac790f1661358fe1c33d5382}{elm\_map\_overlay\_bubble\_content\_append}}(bubble, bx);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_bt\_zoom\_in(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *ev \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *map = data;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} zoom;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gaacec2a1019adf71a9b7e3b5fa011c90e}{elm\_map\_zoom\_mode\_set}}(map, \mbox{\hyperlink{group__Elm__Map__Group_ggae60f2343c0e098264c246d7e2679abe5a35d8c2519926ab59a7bd5835739cd9b7}{ELM\_MAP\_ZOOM\_MODE\_MANUAL}});}
\DoxyCodeLine{   zoom = \mbox{\hyperlink{group__Elm__Map__Group_ga8e5d0739948105e07d77a00013831f6c}{elm\_map\_zoom\_get}}(map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga6869a7b99657ee01b0ee19c68c47fc0a}{elm\_map\_zoom\_set}}(map, zoom + 1);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_bt\_zoom\_out(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *ev \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *map = data;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} zoom;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gaacec2a1019adf71a9b7e3b5fa011c90e}{elm\_map\_zoom\_mode\_set}}(map, \mbox{\hyperlink{group__Elm__Map__Group_ggae60f2343c0e098264c246d7e2679abe5a35d8c2519926ab59a7bd5835739cd9b7}{ELM\_MAP\_ZOOM\_MODE\_MANUAL}});}
\DoxyCodeLine{   zoom = \mbox{\hyperlink{group__Elm__Map__Group_ga8e5d0739948105e07d77a00013831f6c}{elm\_map\_zoom\_get}}(map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_ga6869a7b99657ee01b0ee19c68c47fc0a}{elm\_map\_zoom\_set}}(map, zoom -\/ 1);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_bt\_zoom\_fit(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *map = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gaacec2a1019adf71a9b7e3b5fa011c90e}{elm\_map\_zoom\_mode\_set}}(map, \mbox{\hyperlink{group__Elm__Map__Group_ggae60f2343c0e098264c246d7e2679abe5a2146e83a3cb0809732a6643a765b6e21}{ELM\_MAP\_ZOOM\_MODE\_AUTO\_FIT}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_bt\_zoom\_fill(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *map = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Map__Group_gaacec2a1019adf71a9b7e3b5fa011c90e}{elm\_map\_zoom\_mode\_set}}(map, \mbox{\hyperlink{group__Elm__Map__Group_ggae60f2343c0e098264c246d7e2679abe5a380228deffe851d3598cd2b0e22948ad}{ELM\_MAP\_ZOOM\_MODE\_AUTO\_FILL}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* FIXME: it shouldn't be required. For unknown reason map won't call}}
\DoxyCodeLine{\textcolor{comment}{ * pan\_calculate until shot delay time, but then it will take a screenshot}}
\DoxyCodeLine{\textcolor{comment}{ * when the map isn't loaded yet (actually it won't be downloaded, because}}
\DoxyCodeLine{\textcolor{comment}{ * after the SS it will kill the example). */}}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_nasty\_hack(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o = data;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e = \mbox{\hyperlink{group__Evas__Object__Group_gae1058082dae7b97590c41f43405dfdbf}{evas\_object\_evas\_get}}(o);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga0cfa7df81a1c781997f7cdcb8aa4f69e}{evas\_smart\_objects\_calculate}}(e);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gae0c653baad8836232c0dc27f91f875d6}{ECORE\_CALLBACK\_CANCEL}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} **argv \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *map, *box, *bt;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *ovls = NULL;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Elm__Map__Overlay}{Elm\_Map\_Overlay}} *ovl, *city\_clas, *country\_clas;}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[255];}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__App_ga0cefb59efb95841232561d67e34d9909}{elm\_app\_info\_set}}(elm\_main, \textcolor{stringliteral}{"{}elementary"{}}, \textcolor{stringliteral}{"{}images"{}});}
\DoxyCodeLine{   data\_dir = \mbox{\hyperlink{group__Elm__App_ga92a09dbf88cc1ca3eab51c51dea589d0}{elm\_app\_data\_dir\_get}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/rock\_01.jpg"{}}, \textcolor{stringliteral}{"{}sdf"{}});}
\DoxyCodeLine{   data\_argentina.file = strdup(buf);}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/rock\_02.jpg"{}}, \textcolor{stringliteral}{"{}sdf"{}});}
\DoxyCodeLine{   data\_chile.file = strdup(buf);}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/sky\_01.jpg"{}}, \textcolor{stringliteral}{"{}sdf"{}});}
\DoxyCodeLine{   data\_sampa.file = strdup(buf);}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/sky\_02.jpg"{}}, \textcolor{stringliteral}{"{}sdf"{}});}
\DoxyCodeLine{   data\_rio.file = strdup(buf);}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), \textcolor{stringliteral}{"{}\%s/images/sky\_03.jpg"{}}, \textcolor{stringliteral}{"{}sdf"{}});}

\end{DoxyCodeInclude}
 To return an icon, all we need to do is to add a elm\+\_\+icon and return it\+:  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\_icon\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *file)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *icon = \mbox{\hyperlink{group__Elm__Icon_ga5739728c1209f90422cf65a778a16502}{elm\_icon\_add}}(obj);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Image_gad1a96ede5f513042cef3c1dac4572f73}{elm\_image\_file\_set}}(icon, file, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(icon);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} icon;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 For the content, let\textquotesingle{}s return something more elaborate. We will return a box with an image representing the place, and the name of this place\+: 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\_box\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj, Overlay\_Data *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bx, *img, *label;}
\DoxyCodeLine{   bx = \mbox{\hyperlink{group__Elm__Box__Group_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(obj);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{   img = \mbox{\hyperlink{group__Evas__Object__Image_gadd901a6b181c38dc040537b3fd76fcc6}{evas\_object\_image\_add}}(\mbox{\hyperlink{group__Evas__Object__Group_gae1058082dae7b97590c41f43405dfdbf}{evas\_object\_evas\_get}}(obj));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(img, data-\/>file, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga26dff9f60428cac5e02bc822b025031a}{evas\_object\_image\_filled\_set}}(img, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga3014f5c9dfbdc6c7af41a27826e50e57}{evas\_object\_size\_hint\_min\_set}}(img, 64, 64);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(img);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, img);}
\DoxyCodeLine{}
\DoxyCodeLine{   label = \mbox{\hyperlink{group__Elm__Label__Group_ga01e161a300e3ee6f7a13a44505724e03}{elm\_label\_add}}(obj);}
\DoxyCodeLine{   elm\_object\_text\_set(label, data-\/>name);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(label);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Box__Group_ga66a10dd861578521af2ab7b8c2ca65c5}{elm\_box\_pack\_end}}(bx, label);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} bx;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 See \mbox{\hyperlink{map_example_02_8c-example}{map\+\_\+example\+\_\+02.c}} for full source, whose window should look like this picture\+:

 
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{screenshots/map_example_02}}
\end{DoxyImageNoCaption}
 