How to get the address from a marker?

77 views
Skip to first unread message

Daniel Montenegro

unread,
Jan 16, 2013, 7:20:06 PM1/16/13
to google-map...@googlegroups.com
Hi there!

I need to fill a table column (mysql) with the address of any marker that users place in the map.

So, would something like

var nameAddress = marker.results[1].formatted_address;

works?

I'm not looking for some kind of reverse geocode...

Thanks in advance,

Daniel

geoco...@gmail.com

unread,
Jan 16, 2013, 8:13:38 PM1/16/13
to Google Maps JavaScript API v3
On Jan 16, 4:20 pm, Daniel Montenegro <dmontenegr...@gmail.com> wrote:
> Hi there!
>
> I need to fill a table column (mysql) with the address of any marker that
> users place in the map.
>
> So, would something like
>
> var nameAddress = marker.results[1].formatted_address;
>
> works?

Not unless you have added a results array to the marker somehow, that
is not a property provided by the API.

>
> I'm not looking for some kind of reverse geocode...

Unless your code saves the address information somewhere, it wont' be
available for retrieval, reverse geocoding will be the best you can
do. You need to provide more context (i.e. a link to your working map
that you want to add this functionality to), if you want more detailed
help.

-- Larry

>
> Thanks in advance,
>
> Daniel
Reply all
Reply to author
Forward
0 new messages