Languages

Menu
Sites
Language
Maps in Tizen Native App

Hello there i currently started with new project in which i have to allow user to drop the pin on the Map

i am not getting how to retrieve the Lat Long by the click of Map

here is my code to create basic map :

        ad->map = elm_map_add(ad->conform);
 	evas_object_size_hint_weight_set(ad->map, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
	evas_object_size_hint_align_set(ad->map, EVAS_HINT_FILL, EVAS_HINT_FILL);
	elm_map_zoom_mode_set(ad->map, ELM_MAP_ZOOM_MODE_MANUAL);
	elm_map_zoom_set(ad->map, 14);
	evas_object_show(ad->map);
	elm_map_region_show(ad->map, 72.866041, 21.229097);
	elm_object_content_set(ad->conform, ad->map);


	Elm_Map_Overlay *ovl = elm_map_overlay_add(ad->map, 72.866041, 21.229097);
	elm_map_overlay_displayed_zoom_min_set(ovl, 8);
	Evas_Object *icon = elm_icon_add(ad->map);
	elm_icon_standard_set(icon, "home");
	elm_map_overlay_icon_set(ovl, icon);
	evas_object_smart_callback_add(ad->map, "clicked", _map_clicked_cb, ad);

here i had added the static Lat Long i.e. :

elm_map_region_show(ad->map, 72.866041, 21.229097);

i need Current location first and then alow user to drop pin on map and then get those Lat Long from map

i am not exatly getting how should i get those the Lat Long

Please Help , Thanks 

Dinal Jivani

View Selected Answer

Responses

8 Replies
John Ixion

hello,

 

are you using Mapzen maps ? https://mapzen.com/documentation/

Dinal Jivani

yes i will use the Mapzen maps now, i had already signed up to Mapzen and got a key also..?

what are the next steps now ?

Dinal Jivani

and i am currently working with the Tizen Studio 2.0

John Ixion
John Ixion

a reverse geocoding example for mapzen

 

https://mapzen.com/documentation/search/reverse/

Dinal Jivani

Thank You Olivier Nyssen,

i am getting it , 

but my question is how can i get the Lat Long of the place where user dropped the pin ..?

i.e. : I want Lat Long from map ,on user's click on Map.

because if i  had the Lat long then and only then i can call the reverse geocoding using those Coordinates 

Mark as answer
Dinal Jivani

Hello there, 

I had tried in many ways and at last i got the Lat Long by the map click. :

i had use the Coordinates of the canvas ,

and then converted map canvas to region using elm_map_canvas_to_region_convert();

Thanks for the Help

- Dinal Jivani

K Johnson

Hi Dinal Jivani,

Please go through Creating Map View Objects section of this link. In this link, find the code to create a marker as a map_view object. After that add event by following Managing Map View Events section. According to this section, inside __main_view_event_cb callback get the gesture type(such as tap, double tap, etc) and then write code to apply reverse geocoding on that particular latitude, longitude.