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

129
Views
Google Geocoder.Geocode() restrict to multiple countries

I'm trying to get a location based on an entered city name using the Google geocode api. I want to restrict the search to The Netherlands, Belgium and Germany and prioritize The Netherlands.

In the documentation I see that it's not possible to restrict to multiple countries, as the 'country' parameter only accepts a string and not an array as in the autocomplete api. https://developers.google.com/maps/documentation/javascript/geocoding#ComponentFiltering

Is it possible to do this with the geocode api?

I currently have this to restrict to just The Netherlands:

    var request = { address: q, region: "NL", componentRestrictions: { country: "NL" } };

    this.geocoder.geocode(request, function (results, status) {
        debugger;
        if (status === google.maps.GeocoderStatus.OK) {
            var center = results[0].geometry.location;
            ctx.map.setCenter(center);
            ctx.map.setZoom(12);
            ctx.onLocated(center, results[0], true);
        }
    });

Thanks!

about 4 years ago · Juan Pablo Isaza
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!