geocoordinates

Hi Team,

I wanted to get the geocordinates lattitude and longitude from address entered and show in map .

Please suggest as the co-ordinated are getting 0.I have used geocoding extension.

Locmap1.oml

Hi Ujwwala 

You are trying to print lat and long only. Can you check printing Error What is shows? You may get some idea from there. It has one output of Error as well. 

Also have you marked Sensor True or false? 

Champion

Hi ujwwala,


For address to lat long, you need to use google geocoding API (https://developers.google.com/maps/documentation/geocoding/overview)

The easiest is call this REST 

https://maps.googleapis.com/maps/api/geocode/json?address=[YOUR ADDRESS]&key=[YOUR_API_KEY]

But you need Google API key to do this.


Another alternative, you can use openstreetmap geocoding (I already put this function on my component https://www.outsystems.com/forge/component-overview/8029/openstreetmapplugin)

Hi,


I have used geocoding extension and using api key but it says

Champion

Hi ujwwala,


1. please hide your API  Key (:D)

2. the API key must set with Geocoding API (see my image below on google developer console)

Champion

Hi,


Copy the error message (complete) to here


Thanks

Champion

Hi ujwwala,


I got some incorrect information to you, sorry about that.

The address, you must replace space with enter as example below.

The address is : jakarta kebon jeruk raya perjuangan

you must put it as example below, change space to plus (jakarta+kebon+jeruk+raya+perjuangan)

https://maps.googleapis.com/maps/api/geocode/json?address=jakarta+kebon+jeruk+raya+perjuangan&key=[MYKEY]


Hi,

I have entered only one city and hence no + reqquired but not working.It is takein %20 auto.

Champion

Hello ToTo

I had discussion with Ujjawala. They have created Google API but the account and project is not associated with any Billing Account. So, whatever we do if the API is not associated it will not work. So, there is no mean for trying with the same. 


https://cloud.google.com/maps-platform/pricing 


@ujwwala tembbekar, now there are two options for you - 

  1. You can use the attached CSV of all World City Lat and Long (Predefind) and show on your website. 
  2. You fine some other API that has limited free access and not require credit card information to use free quota. 


Please feel free to ask in case of any further question.


Regards

worldcities.csv

Champion

I see,

If the problem is the pricing of google cloud, then back to my first answer, use the API open street map (its open source) 

example : https://nominatim.openstreetmap.org/search/mumbai?format=json&addressdetails=1&limit=1


Hi Ujjawala 

Please do let me know if this has solved the issue. Else I will share the new OML with Testing API that will help you out. 

Hi Manish,

Please share oml where geocoding extension example with CITY as input to be shown in map

Hello Ujwwala

Sure, I am sent one message to you regarding the OML. Please look into your inbox. 

Thanks

Hi Manish,

I am not getting to show location in map,It is showing as marker,

Please check

locationadd1.oml

Champion

ujwwala,


Your code is very messy and not using best practice (ie : client action called multiple server action) also you didn't call the marker function but expecting marker to be shown on the map.

I tried to modify your oml (it should work now) but I didn't fix the best practice using Outsystems (sorry will take more time to do this than to show you how to use the plugin)


locationadd1.oml

Hi Toto,

Thank you ,It is working but I have tried similar in my existing but  not working,

Can you please suggest

locationadd2.oml

Champion

Hi Ujwwala,


Can I ask what is not work ? because I already download your oml and it working.

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