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

119
Views
Google places autocomplete library

I am wanting to restrict the search results of a google places search to just locations in the UK on reading the documentation I have add an attribute the libraries URL,

components=country:gb

I have added this so my script src now looks like,

https://maps.googleapis.com/maps/api/js?key={MY_API_KEY}&libraries=places&components=country:gb&callback=initMap

But i can still return results from outside of the UK, I assume I am doing some wrong with my script src?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Kindly replace gb with uk

https://maps.googleapis.com/maps/api/js?key={MY_API_KEY}&libraries=places&components=country:gb&callback=initMap

about 4 years ago · Juan Pablo Isaza Report

0

Looks like it's a param of the service not the request URL, so I had to do,

return this.service.getPlacePredictions({
    input: searchValue,
    componentRestrictions: { country: 'gb'}
}, this.displayResults.bind(this));
about 4 years ago · Juan Pablo Isaza 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!