I want to get the latitude and longitude for this address: Boulevard de la Marne Zone industrielle, COULOMMIERS, 77120, France
I am adding api to my page:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
When I use gmaps, the result is good, but when I want to get its API:
geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': myAdress, 'region': 'FR'}, function (results, status) {...});
It executes the following query:
https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4sBoulevard%20de%20la%20Marne%20%20Zone%20industrielle%20%20COULOMMIERS%2077120%20&7sUS&9sfr-FR&callback=_xdc_._lsoj9s&token=53058
and the result is close to Bamako ...
If I use the borders of the viewport, it executes the following query:
https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4sBoulevard%20de%20la%20Marne%20%20Zone%20industrielle%20%20COULOMMIERS%2077120%20&6m6&1m2&1d40.513799&2d-5.844727000000034&2m2&1d51.727028&2d10.854491999999936&7sUS&9sfr-FR&callback=_xdc_._c84svr&token=29019
It’s better (it’s in France), but it’s not that
The request works well on the google map website: https://maps.google.fr/maps?q=Boulevard+de+la+Marne++Zone+industrielle,++COULOMMIERS,+77120&hl=fr&ll=48.487486,3.922119&spn = 1.541855,4.22699 & sll = 50.485474,25.620117 & sspn = 23.748757,67.631836 & hq = Boulevard + de + la + Marne ++ Zone + industrielle, ++ COULOMMIERS, + 77120 & radius = 15000 & t = m & z = 9
It seems that the only way to get this is to make the following request: http://maps.googleapis.com/maps/api/geocode/json?address=Boulevard%20de%20la%20Marne%20Zone%20industrielle,%20COULOMMIERS,%2077120&components= country: FR & sensor = false
I don’t understand why the result is different when using the viewport, not the country (these two results are within the viewport).