Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda