Page 6 of 9
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 7:11 am
by Kateryna Grynko
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:
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:
The created service should be invoked only after Geolocation service. On Success event add action "Invoke service" and invoke the service.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 7:29 am
by jimmy vu
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 7:44 am
by jimmy vu
Incorrect format. Please verify sample response data and try again.
I keep getthing this err. Won't map.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 7:49 am
by jimmy vu
nevermind figured out how to extract it from the response.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 7:57 am
by jimmy vu
still shows numbers, should i changes this:\\Tiggzi('inputSource').val(data.coords.latitude + ', ' + data.coords.longitude);
to the "address" variable?
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 8:06 am
by Kateryna Grynko
Jimmy,
Try commenting the line as you suppose. Also please be sure Rest service that gets address by coordinates is invoked correctly.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 8:10 am
by jimmy vu
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.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 8:12 am
by jimmy vu
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?
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 8:28 am
by jimmy vu
omg going to bed, still no formatted address.
How do i get the value of a geolocation to insert into textbox
Posted: Fri Apr 05, 2013 8:35 am
by Kateryna Grynko
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.