0

There is an address that I want to find on the map вул Південна 10 місто Одеса

Looking:

...

<script type="text/javascript" src="https://maps.google.com/maps/api/js?key=..."></script>

...

function addMarkerByAddress(id, Adres){
    var geocoder = new google.maps.Geocoder();
    geocoder.geocode( { 'address': Adres}, 
        function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                var latlng = results[0].geometry.location;
                var marker = addMarker({
                    id: id,
                    position: latlng
                });
            }
        });
}

As a result, the marker will appear at: вул Південна дорога 10 місто Одеса

If you go to maps.google.com and interactively enter there вул Південна 10 місто Одеса, Google will detect it correctly.

Is it possible to do something to know if address was defined correctly with google.maps.Geocoder() ?

Codemole
  • 3,069
  • 5
  • 25
  • 41
  • 1
    The Google Maps API Geocoding Service is not an address validator, it returns the best match and includes information in the response about the quality of the result. – geocodezip Jan 06 '17 at 12:10
  • It looks like in this particular case Geocoding API cannot distinguish between вулиця (street) and дорога (road). I can see that rooftop address 'Південна вулиця, 10' exists with place ID ChIJuzUKXI0xxkARfrqbHGi2d1w, but Geocoding prefer ' Південна дорога, 10' with place ID ChIJfznMCcs6xkARgIFwDavzE4E. Can you use place autocomplete element to solve this situation? Take a look at the Geocoding [best practices](https://developers.google.com/maps/documentation/geocoding/best-practices). – xomena Jan 08 '17 at 11:17

0 Answers0