193
Views
14
Comments
Get address from Latitude and longitude using API

Hello all,

I'm getting the latitude and longitude using Location plugin in my records.

Now By using these lat and long I want to get address of that record.

I used Many dependencies such as Google Maps plugin, Native GeoCoder Plugin etc..

But not getting the result. I'm using the Mobile web app and testing in outsystems.

Please Help.

My Error is Native Geocoder is not defined

Cordova is not defined.

I need to check this feature in this mobile web app, how can I do this?

2022-08-03 04-32-50
Ravi Punjwani

Hi Dev,

  1. Are you already using this in a Mobile App or Reactive Web App?
  2. Have you tried using this forge component?
    https://www.outsystems.com/forge/component-overview/464/google-geocoding
  3. In mobile apps, if you change / add any cordova plugins, you need to regenerate the android apk file (it will automatically trigger regeneration). Then re-install in your device to see your used plugins working.

Let me know this helps. Or if this doesn't help either :)

UserImage.jpg
Dev Limbachia

Hello Ravi,

I'm using the mobile app in outsystems, I'm using through outsytems only, Do i need to plublish or release the app?

And this component you provided says it converts address into lat and long.

Not lat and long to address.

2022-08-03 04-32-50
Ravi Punjwani

You can follow this forum post for guidance on how to implement the other forge component Google Maps Library

https://www.outsystems.com/forums/discussion/21956/google-maps-library-bug-found-single-location-map-cannot-reverse-geocode-addre/

It is a reactive module. Since your use case doesn't need any native functionality, I guess it shouldn't need reinstalling anything.

Another way is to look at this forge component. https://www.outsystems.com/forge/component-overview/8252/travelling-salesman-problem

This app uses reverse geocoding in their code, so you can refer it and implement the same on your app.

UserImage.jpg
vikas sharma
Champion

Hi,

You just need to call the Google's Geocode api to get the address from lat, lng. There are javascripts api also available which you can directly. You need to pass the Google api key in the request.

https://developers.google.com/maps/documentation/javascript/geocoding

URL

regards

UserImage.jpg
Dev Limbachia

Hi Vikas, 

I'm not familiar to javascript so far, can you explain it in detail? how can I implement this in outsystems.

Thank you.

2018-08-27 08-29-35
Fábio Vaz

Hello Dev,

You trying to use a Cordova Plugin in a React web App?

What you need is something like this:

https://www.outsystems.com/forge/component-overview/4691/utilities-google-maps


UserImage.jpg
Dev Limbachia

Hello Fabio,

I have coordinates with me and from coordinates i want to get address and the component is not giving the expected results.

Thank you.

2018-08-27 08-29-35
Fábio Vaz

Hello,

You have the service getaddresstocoordinates

UserImage.jpg
Dev Limbachia

Hello,

It is requesting me to provide full address :(

There is no option to enter lat and long attributes in it.

2018-08-27 08-29-35
Fábio Vaz

In Fact that action is "wrong".

Can you check this one?

UtilitiesGoogleMaps.oml
UserImage.jpg
Dev Limbachia

Hello Fabio,

I downloaded the reference module and this oml has the service module.

I tried to copy form this and gave me 400 bad request.

Could you provide me the service module?

Thank you in advance

2018-08-27 08-29-35
Fábio Vaz

Hello,

you have the service here:

You can do a test, double click on that "action" and 

Im getting 200 OK

UserImage.jpg
Dev Limbachia

Thank you Fabio Sir for putting this much efforts for my query,

but sir, I checked in my REST there was no service available. SO I copied it from the oml you provided and pasted in REST.

Do we need to do billing for this testing? as my error says I need to enable my billing 


Is there nothing other option where without any billing I can test this?

2018-08-27 08-29-35
Fábio Vaz

Unfortunately Google requires that for test propose too, you have a number of free requests, but you need always to set the billing even if you don't reach the max number of free requests.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.