Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

349
Views
how to filter address according country and city in google maps autocomplete address api

How to filter address according country and city in google maps autocomplete address api. i am able to address filter according country but i am not able to address filter according country and city. I am using following code:-

 var autocompleteFrom;
    $(document).ready(function () {
        var options = {
            types: ['geocode'],
            componentRestrictions: { country: "IL" }
        };
        var inputFrom = document.getElementById('Address');
        autocompleteFrom = new google.maps.places.Autocomplete(inputFrom, options);
        google.maps.event.addListener(autocompleteFrom, 'place_changed', fillAddrss);
    });
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is no way to apply a city filter in place autocomplete at the moment.

There is a feature request in Google issue tracker to make this happen. However we cannot see any ETA there.

I can suggest staring the feature request to add your vote and receive updates from Google.

As a workaround you can define city bounds and filter results by city bounds applying a strictBounds parameter

var options = {
    bounds: cityBounds,
    strictBounds: true,
    types: ['geocode'],
    componentRestrictions: { country: "IL" }
};

Please refer to docs for further details:

https://developers.google.com/maps/documentation/javascript/reference#AutocompleteOptions

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!