정확한 질문을 이해했다면 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);
}
});
참고 : 물론 여기에 우크라이나의 국가 코드를 설정해야합니다. 그리고 주소 나 위도/경도 중 어느 정보를 언급하지 않았기 때문에 주소에 대한 예를 들어주었습니다.