Page 1 of 3

google map address

Posted: Wed Feb 20, 2013 1:05 pm
by Michael4771079

Hi,
I have a google map that will find the gps position of the phone, the address shows on the map with a marker, is there a way for the found address to be inserted in text into the input component,

heres a screenshot
hope this helps

Image


google map address

Posted: Wed Feb 20, 2013 2:30 pm
by maxkatz

If you got the address string, you can do something like this to set the value into the input component:

code
Tiggzi('input_name').val(address);
/code

http://docs.tiggzi.com/javascript-api/


google map address

Posted: Wed Feb 20, 2013 5:21 pm
by Michael4771079

Thanks Max,
Im lost here, do I get address string with js or jquery?

I came accross this,is this where I need to be?

var street = $(xml).find("address").find("street").text();


google map address

Posted: Wed Feb 20, 2013 5:45 pm
by maxkatz

How do you get the address string into the marker?


google map address

Posted: Wed Feb 20, 2013 6:20 pm
by Michael4771079

I dont know how to get the address string into the marker,


google map address

Posted: Wed Feb 20, 2013 11:10 pm
by maxkatz

[quote:]
I have a google map that will find the gps position of the phone, the address shows on the map with a marker
[/quote]
I thought you are able to display it...


google map address

Posted: Wed Feb 20, 2013 11:31 pm
by Michael4771079

Sorry Max,
I misunderstood,
the map is the geolocation plugin, with invoke service onclick, I can see that I have other components "marker1, map1 and location

so I tried the code above on marker1, value change, run custom js

Tiggzi(findtext'input').val(address);

didn't work, but i'm out of my depth again!


google map address

Posted: Thu Feb 21, 2013 2:15 am
by maxkatz

Place a label component inside the marker, and try:
Tiggzi('label_component_name').text(address);

it assumes that you already have the address value.


google map address

Posted: Thu Feb 21, 2013 1:12 pm
by Michael4771079

Hi,
I have tried numerous way to achieve this, but no luck.

I am able to get the marker to display the current location of a phone on button click.

Max supplied the code above to be used assuming I have the address value,

Can you tell me where the address value would be?

Which components has this info after button click?

I have placed a label inside the marker
and used the following Tiggzi('markerlabel').text(address);
on value change with no result


google map address

Posted: Thu Feb 21, 2013 1:47 pm
by Kateryna Grynko

Hello,

Google has special API to find address by coordinates
https://developers.google.com/maps/do...

For example, if you open URL:
http://maps.googleapis.com/maps/api/g...
Google will return JSON structure contain coordinates (54.978334, -1.617361)