2017-01-30 5 views
-1

우크라이나 우편 번호를 지오 코딩하는 가장 효과적이고 정확한 방법은 무엇입니까? 내장 된 지오 코드 객체를 사용하면 대량의 흐린 결과가 발생합니다 (일반 영역 만 반환하는 많은 엽서 코드).Google Maps API로 우크라이나 우편 번호를 지오 코딩하는 가장 좋은 방법은 무엇입니까?

JavaScript로 연결할 수있는 무료 우크라이나 우편 코드 지오 코딩 서비스가 있습니까?

답변

2

정확한 질문을 이해했다면 componentRestrictions을 간단히 설정할 수 있습니다. 다음과 같이 수 :

doGeocode: function (address, postal_code, callback) { 
    console.log("TEST: " + address.toString()); 
    var geocoder = new google.maps.Geocoder(); 
    geocoder.geocode({ 
     'address': address, 
     'componentRestrictions': { 
      'postalCode': postal_code, 
      'country': 'de' //change this to the Code of Ukraine 
     } 
    }, function (results, status) { 
     if (status === google.maps.GeocoderStatus.OK) { 
      console.log(results); 
      callback(results); 
     } else { 
      //Error handling 
      alert('Geocode was not successful for the following reason: ' + status); 
     } 
    }); 

참고 : 물론 여기에 우크라이나의 국가 코드를 설정해야합니다. 그리고 주소 나 위도/경도 중 어느 정보를 언급하지 않았기 때문에 주소에 대한 예를 들어주었습니다.