2017-01-30 6 views

Antwort

2

Wenn ich Ihre Frage richtig verstanden habe, können Sie einfach eine componentRestrictions setzen. Könnte wie folgt aussehen:

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

Hinweis: Natürlich haben Sie hier die Landesvorwahl für die Ukraine zu setzen. Und weil Sie nicht erwähnt haben, welche Informationen Sie entweder Adresse oder lat/lng haben, habe ich Ihnen nur ein Beispiel für Adressen gegeben.

Verwandte Themen