Languages

Menu
Sites
Language
Is possible to embed map into native app?

Hi,

I am in programming a demo native app regarding GPS. I can get the device(Samsung Z1) current Geo location(longitude/latitude), also I can get the address info (xml format) via Nokia Here online geocoding service, but it's text format info, I want to show it in maps. Is there a way to embed the map into my native app window?

Anybody have similiar experience? Many thanks for any suggestion. :)

Edited by: Vikram on 31 Jul, 2015

Responses

5 Replies
Vikram

Z1 has the Nokia Here app installed, is it possible to launch the app and put the longitude/latitude as extra data, then the here map shows the address detials.

If yes, please share the relative api or sample code. Thanks a lot!!!

Alex Dem

Hi, 
Regarding maps in Tizen, try to look here:
​https://developer.tizen.org/development/guides/native-application/ui/ui-control/elementary-widgets/ui-widgets-0#map
https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__Map.html
Hope this help.
Alexey.

Vikram

Hi, Thanks! 

I can show the map in my native app. but there's another issue caused by the map widget. 

as my sample code, the map shows correctly, but the header container not showing(with a blank area in header container), if I comments the map widget code, it's shows correctly. Many thanks for any suggestion, :)

static Evas_Object*
create_main_view(appdata_s *ad)
{
    Evas_Object *container, *header;
	Evas_Object *entry, *button;
	Evas_Object *map;

	container = elm_box_add(ad->conform);
	elm_box_align_set(container, 0, 0);
	evas_object_size_hint_weight_set(container, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(container, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_show(container);
	elm_box_padding_set(container, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(15));

	header = elm_box_add(container);
	elm_box_align_set(header, 0, 0);
	elm_box_horizontal_set(header, EINA_TRUE);
	evas_object_size_hint_weight_set(header, EVAS_HINT_EXPAND, 0);
	evas_object_size_hint_align_set(header, EVAS_HINT_FILL, 0.5);
	evas_object_show(header);
	elm_box_padding_set(header, ELM_SCALE_SIZE(5), ELM_SCALE_SIZE(15));
	elm_box_pack_end(container, header);

	button = elm_button_add(header);
	elm_object_text_set(button, "i");
	evas_object_size_hint_weight_set(button, 1, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_padding_set(button, ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(5),ELM_SCALE_SIZE(5));
	//evas_object_smart_callback_add(button, "clicked", btn_login_clicked_cb, (void*)ad);
	evas_object_show(button);
	elm_box_pack_end(header, button);

	entry = elm_entry_add(header);
	elm_entry_scrollable_set(entry, EINA_TRUE);
	elm_object_part_text_set(entry, "elm.guide", "input your DA!");
	evas_object_size_hint_weight_set(entry, 5, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_padding_set(entry, ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(15),ELM_SCALE_SIZE(15));
	evas_object_show(entry);
	elm_box_pack_end(header, entry);

	button = elm_button_add(header);
	elm_object_text_set(button, "Go!");
	evas_object_size_hint_weight_set(button, 1, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
	evas_object_size_hint_padding_set(button, ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(1),ELM_SCALE_SIZE(5),ELM_SCALE_SIZE(5));
	//evas_object_smart_callback_add(button, "clicked", btn_login_clicked_cb, (void*)ad);
	evas_object_show(button);
	elm_box_pack_end(header, button);


	map = elm_map_add(container);
	evas_object_size_hint_weight_set(map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(map, EVAS_HINT_FILL, EVAS_HINT_FILL);
	elm_map_zoom_mode_set(map, ELM_MAP_ZOOM_MODE_MANUAL);
	elm_map_zoom_set(map, 12);
	elm_map_region_bring_in(map, 2.2, 48.8);
	evas_object_show(map);
	elm_box_pack_end(container, map);

	return container;
}

 

Vikram

Resolved!

Just create a box container as the parent of map widget, and packed the box to its parent the "container" box.

Alex Dem

Hi,
Maybe you could wrap your map in one more box and place this box below header box on container box too? It should work.
Alexey.