If I pass such parameters, then I do not correctly calculate the coordinates. If I just insert the address into the google map, the coordinates are calculated correctly. Please tell me what the problem is? Tried to add & region = us & components = country: US, did not help.
PS The problem does not occur with all addresses, but after all, in the visual map at google / maps it correctly defines the address ...
Code:
$address = '424 Rosevale Ave, Ronkonkoma, NY 11779, USA'; $xml_pos = file_get_contents('https://maps.googleapis.com/maps/api/geocode/xml?address='.urlencode($address).'&key='.$api_key);