Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do i get the value of a geolocation to insert into textbox

Google has a Rest Service for getting address by geolocation: https://developers.google.com/maps/do...

You would need to create Rest Service with the following parameters:
URL: http://maps.googleapis.com/maps/api/g...
Request parameters:

  • "latlng"

  • "sensor", value = true

    To get response parameters, on "Test" tab enter the value latlng=40.714224,-73.961452 and click "Test". Service will send data back. Then click "Automatically Create Service Response".

    To make the service work on location page add it to page and create the following mapping:
    Image

    Click "Add JS" in front of request parameter latlng and paste the following code:
    codereturn localStorage.getItem('lat') + ',' + localStorage.getItem('lng');/code
    Mapping for response parameters is the following:
    Image

    The created service should be invoked only after Geolocation service. On Success event add action "Invoke service" and invoke the service.

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

Awesome, trying now,

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

Incorrect format. Please verify sample response data and try again.

I keep getthing this err. Won't map.

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

nevermind figured out how to extract it from the response.

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

still shows numbers, should i changes this:\\Tiggzi('inputSource').val(data.coords.latitude + ', ' + data.coords.longitude);

to the "address" variable?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do i get the value of a geolocation to insert into textbox

Jimmy,

Try commenting the line as you suppose. Also please be sure Rest service that gets address by coordinates is invoked correctly.

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

ok i understand but i'm kinda having a hard time doing this translation? So the Reverse Geo has to be included? I'm sorry I'm new to this and not clear on what you mean or how to code it yet.

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

i have a geolocation service, and a reverse geo location service, and now this address location service. Do they all need to be part of the page?

how to i code the .val of the inputSource?

jimmy vu
Posts: 0
Joined: Thu Apr 04, 2013 10:26 am

How do i get the value of a geolocation to insert into textbox

omg going to bed, still no formatted address.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do i get the value of a geolocation to insert into textbox

You have "reverse geo" service for getting address from coordinates.
On geolocation service success you should execute "reverse geo".

As it's mentioned before (https://getsatisfaction.com/tiggzi/to...)
for geolocation service add on Success event action - invoking another Rest Service.

Also you can create mapping for "reverse geo" service as I mentioned before.

Return to “Issues”