How do I filter Google Maps results for a specific region?

Asked

Viewed 737 times

3

I’m with a route system that captures user data and maps routes on the map:

geocoder.geocode({ 
    'address': endereco + ', Brasil', 
    'region': 'BR' 
}, function (results, status) {}

The problem is that it is returning addresses from all over Brazil and in some cases even outside it.

How to configure the script to search only in a specific city? Ex: Search only locations that are within Belo Horizonte.

1 answer

4


  • 1

    I also did not know these properties, I deleted even my comment ;) Excellent!

  • I get it. And where do I get the code for this administrative property? For example, I want it to be Uberlândia...

  • It’s not code, it’s just the abbreviation of the city name, you can write the full name: 'administrativeArea':'Uberlândia' @Hitchleonardo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.