Converting Coordinates to Address in Mobile Application

Converting Coordinates to Address in Mobile Application

  

My concept was accessing the users location and show their location in the app, Through location plugin i accessed the coordinates, with help of the coordinates i can display their location through GoogleMapsMobile, But now what my need is, converting those coordinates to address.. I need to display the address in an expression..

Please find the oml file below so you can get some clear idea about my need..

Hello Keerthi,

Since you'll always need a third party service to convert those coordinates, the Google Maps available on forge has the service that you're looking for, see below image:


Let me know if it worked.


Cheers,

Henrique

Hi Henrique,

Thanks for your response, but i am developing a Mobile Application not a Web Application,But anyhow i have tried but not succeeded with that..the Expression was not responding..I saved the Latitude and Longitude in a separate Local Variables..In Conversion action i have passed those values and created an address variable to store the address.And then Created a button action to show the Address after click, In the button action i included the CoordinteToAddress Action..Assigned the Expression value to Address variable.But address was not displaying...


Keerthi,

You can use server actions in a mobile app. Also note that any REST action also always goes throught the server, even if called locally.

Hi ,

I downloaded your logic and it seems correct. Do as Kilian suggests and encapsulate your logic on an server action that receives the coordinates as an input parameter and returns an address.

Since you're having issues, there (on the server action) you can add a breakpoint to see what's going wrong. 

Also keep in mind what the API returns, since google always returns a list of composed addresses, you'll need to pick the one that suits your usecase.


Let me know if it worked or if you need an .oml with a sample.


Cheers,

Henrique

As i am new to outsystems, It cant clearly get kilians idea..

So your sample .oml file will be more useful

Or u can help me with some step procedures ..

Solution

Hi again,

After some debug on your code i managed to see what's the problem.

All your code is correct, except the API key. You need to generate your own on Google Developers console, otherwise it won't work. I guess the API key that you have doesn't have the Geolocation API enabled.

Summing up, you need to go to the Google Developers console and create your own API key. Don't forget to enable all the API's that suit your case and for this particular service, the Geolocation API.


Cheers,

Henrique

Solution

Hi Henrique.,

Thank You for finding me a valuable Solution. It worked, I haven't enabled the Google Maps Geocoding API.

Now I Am Getting The Full Address...

- Keerthi