Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

128
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda