How to get users current Postcode from Latitude and Longitude in Reactive web?
Application Type
Reactive, Service
Service Studio Version
11.10.20 (Build 41361)

Actually, I want to accumulate the postcode of user using latitude and longitude in Reactive Web application. I am able to detect the current location in which latitude n longitude is there but additionally I need the Postcode as well. So, please guide me in this asap. 

Hello @Aditya Chinchole , you can either have a back office or a database with all the postcodes with latitude and longitude and then filter by longitude and latitude to get the postcode itself, or with javascript!!

https://stackoverflow.com/questions/19511597/how-to-get-address-location-from-latitude-and-longitude-in-google-map

Go to the answer on stack and you will find your solution.

Regards,

Márcio C.

Hello @Marcio Carvalho . I have an aggregate with Postcode, lat and lang. Now, i have to detect the location of user and get postcode as well. So, can u plz tell me what will be the javascript for that. I have attached my javascript so that you can tell me the modifications

geolocationscript.jpg

I have to see it clearly, but I think you need to do this.

https://www.outsystems.com/forge/component-overview/1395/location-plugin

Get the latitude and longitude and the formatted address from this location plugin and then pass it. Then you can use geocode API to get the address where you will get the postcode also. Also usually, I prefer to use what OutSystems already have, like @Camila Teixeira said, you can use the documentation on GeoCode API and the uber use case.

These forge components from OutSystems already have the javascript on their components, so you will not have to do the heavy work!!

Can you use it?



Hello, 

I found this article that maybe can help you: https://www.outsystems.com/blog/posts/how-to-create-uber-like-address-selector/ 

In this case, they are using the GeoCode API - https://developers.google.com/maps/documentation/geocoding/overview - that based on latitude and longitude, they return an address. On of the fields returned is the postal code.

Hope that it helps!

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