label not shown in overlay bubble of map

label not shown in overlay bubble of map

BY 11 Sep 2015 Native Application Development

Hi,

I create a map widget, add an icon overlay on it, and add a bubble overlay to follow the icon overlay. Then, create a lable as the content of the bubble, but actually result is the bubble is empty, I can’s see any text content in in the bubble. What’s the problem?

As below sample code:

static void
add_overlay_on_map(appdata_s *ad, AddressInfo *addr)
{
    Evas_Object *icon;
    Elm_Map_Overlay *ovl;
    Evas_Object *button;

    elm_map_region_bring_in(ad->map, addr->longitude, addr->latitude);

    // Add an overlay
    ovl = elm_map_overlay_add(ad->map, addr->longitude, addr->latitude);
    elm_map_overlay_displayed_zoom_min_set(ovl, 8);
    elm_map_overlay_data_set(ovl, addr);

    icon = elm_icon_add(ad->map);
    elm_icon_standard_set(icon, "/opt/usr/apps/org.example.gpsdemo/shared/res/location_32.png");
    elm_map_overlay_icon_set(ovl, icon);

    // Add an overlay bubble object
    Elm_Map_Overlay *bubble = elm_map_overlay_bubble_add(ad->map);
    Evas_Object *title_text = elm_label_add(ad->map);
    evas_object_size_hint_weight_set(title_text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(title_text, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_max_set(title_text, 100, -1);
    elm_object_text_set(title_text, addr->label);
    elm_label_line_wrap_set(title_text, ELM_WRAP_WORD);
    evas_object_show(title_text);
    elm_map_overlay_bubble_content_append(bubble,title_text);
    // Set it to follow a specific overlay (the last created one here)
    elm_map_overlay_bubble_follow(bubble, ovl);
}

 

Written by