Hello everyone: I have a simple text field and a button. In the text field
the user can enter an address and when I press the button, what I do is
geocode the address to get the geographical coordinates. To get them I do
the following:
<? Php
If ($ _POST) {
$ Url =
"http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=";
$ Address = $ _POST ['address'];
$ Call = $ url.urlencode ($ address);
$ Response = json_decode (file_get_contents ($ call), true);
If ($ response ['status']! = 'OK') {
Echo "It was not possible to geocode the address. Please re-enter the
data.";
Exit;
}
}
?>
Now, I know that in the response variable I have the coordinates, but I do
not know how to display them, how to get them ... Can you give me a hand?
PS: I tried to put a variable "$ length" and I made a "count ($ response)"
and it returned a "2" that is, there are the coordinates but I do not know
how to recover them !!!
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-maps-js-api-v3.
For more options, visit https://groups.google.com/d/optout.