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); 

    1 answer 1

    It seems to me that this question should not be asked here, but in support of google. Although of course they rarely answer.
    But apart from them, it’s hardly possible for someone to explain why reverse geocoding for them works differently in their product and their API.

    Although I can assume that the reason is purely commercial - they say develop on our maps, and not on third-party engines, then you will be happy.

    • I do not understand. What are the third-party engines? If I use the standard google maps api geocoding function - Ivan Churkin
    • @IvanChurkin, You don’t write an application based on google libraries, but access their api from some kind of your own (or third-party) application / engine / backend ... Try to make a request via api of their maps (still tyk ) not directly, but create a map on their engine. And compare the result. - t1nk