| Issue 4233: | Autocomplete filter by multiple countries |
1 of 2100
Next ›
|
|
454 people starred this issue.
Comments by non-members will not trigger notification emails to users who starred this issue. |
Back to list |
What would you like to see us add to this API? restrict componentRestrictions to filter by multiple countries ********************************************************* For developers viewing this issue: please click the 'star' icon to be notified of future changes, and to let us know how many of you are interested in seeing it resolved. *********************************************************
Jul 30, 2012
#1
[email protected]
Owner:
[email protected]
Sep 22, 2012
This is a great need
Sep 22, 2012
I need to restrict geocode answers to Europe or other areas like South America. This will be a very easy way to do that. Much more easier than parsing all the results.
Sep 22, 2012
I would like to bring other places can be reached by road from one place. Eg. Africa, Europe, Asia, or South America, North America
Oct 2, 2012
(No comment was entered for this change.)
Labels:
Internal-7273806
Nov 14, 2012
please we also need this feature very urgent for autocompleting Switzerland and the principality of Lichtenstein...!
Nov 21, 2012
it would be wonderful to limit multiple countries (like US and Canada)
Nov 23, 2012
+1. My client needs to be able to restrict results to USA and Mexico only.
Dec 9, 2012
is there any solution yet?
Feb 5, 2013
i need this real bad as well! Thanks in advanced
Feb 6, 2013
common Google... this is highly needed!
Feb 6, 2013
Highly needed indeed. Could you please tell us if you have planned to add this feature ?
Feb 26, 2013
This would be a great feature. Very useful, indeed.
Mar 11, 2013
I also apply to restrict multiple countries e.g. german speaking like Germany, Austria, Switzerland
Mar 11, 2013
Its a must have feature that Google should add.
Mar 14, 2013
(No comment was entered for this change.)
Status:
Acknowledged
Mar 24, 2013
I also apply...
Apr 5, 2013
Really need this feature
Apr 8, 2013
I can't use the API without this feature. Thank you for your work.
Apr 19, 2013
I'm looking for a similar function, I need to restrict it to a continent, or multiple countries within that continent (Africa).
Apr 27, 2013
It would be great to be able to define something like this for multiple countries restriction:
componentRestrictions: {
country: ['us', 'ca']
}
May 14, 2013
I too want to restrict the use to AU/NZ.
May 19, 2013
I agree that US and CA is a great need for us doing business in those parts of North America.
Jun 12, 2013
We really need this!
Jul 16, 2013
It would be nice to have this feature (something like: country: ['us', 'ca'])
Aug 1, 2013
This would be amazing to have.
Aug 9, 2013
Really could use this. Trying to restrict to USA and Canada only. As of now my brothers from the north get no auto-complete :(
Sep 16, 2013
also waiting!
Oct 2, 2013
This is an excellent idea! I am developing a system that will need the results to be restricted to Europe, so at least an option to restrict to larger regions or areas would be truly welcome!
Oct 9, 2013
Please, we need this!
Oct 16, 2013
we need it... in any form json, array comma separate.. whatever.. please help!
Oct 24, 2013
This is essential for the Island of Ireland, made up as it is of The Republic of Ireland (ie) and Northern Ireland (gb - as it is part of "The United Kingdom of Great Britain and Northern Ireland" as Google mentions as an example on their Geocoding page) To implement an autocomplete search box restricted to just the island of Ireland is impossible as none of the Northern Ireland addresses return suggestions if "ie" is specified and specifying "gb" will return Northern Ireland AND the rest of the UK - a completely different island/geo-political area.
Nov 14, 2013
i would love you if you offer an option like "restrictedTo":"ISO 3166 Code" and only return matching results, very great need
Nov 18, 2013
As well as specifying multiple countries, it would be useful to specify a preference order. Eg setting country to "IE, GB" would return IE matches first in preference to GB matches. The viewport biasing option doesn't work very well.
Nov 18, 2013
As well as specifying multiple countries, it would be useful to specify a preference order. Eg setting country to "IE, GB" would return IE matches first in preference to GB matches. The viewport biasing option doesn't work very well.
Nov 18, 2013
Actually, a bit more experimentation shows that the biasing function does work very well - for the Northern Ireland/Ireland problem, I'm able to set a bounds property, and this brings back a good set of predictions for Ireland as a whole. It's not part of the componentRestrictions, but could be useful as an alternative solution.
These are the bounds I'm using for the island of Ireland.
bounds=new google.maps.LatLngBounds(new google.maps.LatLng(51.16694,-10.33001),
new google.maps.LatLng(55.15232,-5.0190));
Nov 18, 2013
@Gavin - thanks for this. The only issue with this is that it will still show locations outside those bounds, locations inside the bounds get preferential display. e.g. "Oma" shows "Omagh"(Co. Tyrone) first then "Oman" and "Omaha".
Nov 19, 2013
yes, it could be very useful
Dec 9, 2013
It would be more useful than sliced bread when you don't have a knife. <img width="317" height="198" src="http://robotdarwin.com/wp-content/uploads/2008/05/sliced-bread2-634x396.jpg">
Jan 8, 2014
I really need this option componentRestrictions: country: ['us', 'uk']
Jan 29, 2014
I need this too!
Mar 5, 2014
I need this too!
Mar 14, 2014
Is there anyway to achieve similar behaviour in the meantime other than making multiple queries and combining the results? The use case of US + Canada would be so useful, and unfortunately, region biasing doesn't work well enough in place of this. +1
Apr 11, 2014
Yes please pretty please !
Apr 15, 2014
Google, pleeeeeeeease!
Apr 15, 2014
Google, what's up? Such an old issue that shouldn't be too hard to resolve but is impossible to work around on the client...?!
Apr 16, 2014
Please, We need it too~~
Apr 17, 2014
Pretty please?
Apr 17, 2014
Any plans on this functionnality? ;)
May 28, 2014
I want US + Mexico Locations in auto populate. is it possible?
May 28, 2014
#51 No, that is not possible. That is what this change request is about. But it's open for two years now and Google has not said if and when it is gonna solve the problem...
Jun 2, 2014
We also provide this autocomplete service for one of our customers who is in germany, austria and switzerland.
We are really looking forward to have something like this:
...
componentRestrictions: {
country: ['at','ch','de']
}
...
or a similar workaround to get all cities from (de,at,ch)...
Jun 13, 2014
I would be nice also, if possible, to have the option to exclude a country from the results
Jun 15, 2014
restriction by the bounds of map is not always helping. many times i need to restrict by the countries on the different part of the world (like us + eu countries).
Jun 23, 2014
still waiting for that
Jun 24, 2014
want this so badly!
Jul 23, 2014
i need sk and cz please
Jul 24, 2014
Would be great to see some progress on this issue. Seems like a simple enough request that would make sense for Google to develop. Providing an array of country codes would be awesome to restrict geocode results to certain countries, and would probably also make everything faster, too.
Jul 31, 2014
I need it with FR and his overseas departments and territories (DOM TOM : Guadeloupe, French Polynesia ...)
Jul 31, 2014
Or simply include the overseas departments from every contries.. Like France > FR + (Martinique MQ, Guadeloupe QP, French Guiana GF, Mayotte YT) Like United Kingdom > GB + (Gibraltar GI ...) It could be very useful...
Aug 28, 2014
My client needs to be able to restrict results to USA and its territories.
Aug 30, 2014
open for 2 years? does this issue have any chance of getting implemented anytime soon? i can add Australia to your list. I am working on an app at the moment that provides data for Australia and its external territories (which are not covered under 'au'). does anyone at least have a suggestion on how it could be done?
Aug 30, 2014
We have created a workaround by providing a selectbox for visitors to choose among available countries. See a working demo here: http://booking.adriatic-transfers.com
Sep 13, 2014
Was just learning to use places library, and ran into this problem immediately! Would love a resolution :)
Sep 15, 2014
+1 this seems like a no brainer, why wouldn't it be available.
Sep 24, 2014
Reported on Jun 26, 2012 and still no update?
Sep 24, 2014
Bing maps ftw! *sigh*
Oct 1, 2014
+1 also for us, we really need this for Western Europe restriction... Still no solution after all these requests & more than 2 years ?!
Oct 8, 2014
Still no update on this?
We need something like country: {us,ca}
Oct 8, 2014
upvote here too! :-)
Oct 14, 2014
I also need to restrict geocode answers to Europe or other regions. Upvote here!
Oct 15, 2014
upvote here!
Oct 15, 2014
Upvote here !
Oct 15, 2014
I'm also looking for ['us', ca'] as an option.
Oct 15, 2014
Same here, we want to get us and ca results only.
Oct 15, 2014
we NEED this! relationship between USA and CANADA depends on this...kind of a big deal
Oct 17, 2014
Until Google allows you to pass an array to the 'region' filter, there is a workaround:
if (status!=='OK') {
// Search using another 'region'
}
Repeat for each region.
Oct 17, 2014
P.S. The above assumes you are restricting by region:'au'. If you are restricting by componentRestrictions:{country:'au'}, then you can do something like this:
if (results[0].formatted_address==='Australia') {
// Search using componentRestrictions:{country:'nz'}
}
This is because when no address is found, the formatted_address will be set to the country name.
Oct 17, 2014
This workaround means 10+ lookups to cover a fraction of western Europe :(
Oct 17, 2014
#80, there is another way: define a boundary for your countries, then use the 'bounds' filter.
Oct 17, 2014
#81 Yes, thanks, already implemented ! But it is not as precise as restrictions : - when autocompleting, I still see places from all over the world - if I want to cover, let's say, France and Germany, I would also include parts of UK, Italy...
Nov 14, 2014
Please allow us to filter by multiple countries! It is so necessary when using Maps from smaller countries or near borders with other countries (europe, singapore).
Nov 28, 2014
Re-support WebGL for Street View Services. Bring mobile spherical projections back on Street View Services. With the new embed api, street view embeds are worthless on mobile.
Dec 9, 2014
still badly needed
Dec 9, 2014
ugly, probably buggy, but worked for me:
geocoder.geocode({ 'address': address + ', Deutschland OR Österreich OR Schweiz' }, function (results, status)
Dec 11, 2014
We need this feature.
Dec 11, 2014
I need this too!
Dec 11, 2014
Come on Google! 180 of us want this!
Dec 11, 2014
After two years waiting, I do not need it anymore ;)
Dec 11, 2014
Come on Google don't be evil, give us this shit!
Dec 25, 2014
My application have this requirement. If we can search from whole world than we should be able to search from two countries too. please provide us that
Dec 31, 2014
Can we please get an update on if this issue will ever be addressed?
Jan 6, 2015
It seems I forgot to post my workaround here. I put it on stackoverflow so more people could find it. I basically get predictions for each country needed, and created a custom autocomplete popup to list the results. In my case I only needed to check for another country (luxemburg) when the current site was in belgium. Hope this helps some people here.. http://stackoverflow.com/questions/26753846/fill-google-maps-autocomplete-with-prediction-results/26886685#26886685
Jan 21, 2015
2 1/2 years... please, Google, go on! Can't be that difficult to implement this
Jan 21, 2015
We initially had a combobox with countries. Now we check on the server if the location is in our list of valid countries and provide error messages if it's outside of the valid list.
Jan 21, 2015
This problem can easily be solved by gathering information on the autocomplete. See this link to fetch data about the location https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform This line of code is the part to be changed. It need to be equals to your country code(s): place.address_components[i][componentForm[addressType]];
Jan 27, 2015
Still no solution from Google? I am getting mad with this issue!
Jan 27, 2015
This would be a fantastic feature and I'm adding my vote. In the meantime, thanks to the people above who've posted several workarounds (luckily I only need to geocode for the UK and ROI).
Feb 11, 2015
The ability to filter by continents at least would be very useful.
Mar 16, 2015
would very much appreciate this feature.
componentRestrictions: {
country: ['aus', 'nz']
}
Mar 19, 2015
Need the capability for lookups like "near Basel" or ?components=country:CH,DE,FR
Mar 19, 2015
same same for overseas territories, it's really painful...
Mar 23, 2015
Still waiting for a response on this one... would be really useful to restrict/bias geocode results to adjoining countries (eg Ireland and Northern Ireland/GB)
Mar 23, 2015
Still no solution?
Mar 23, 2015
About 3 yrs later and still no solution. Thats poor, Google...
Mar 29, 2015
Needed this for project. Sad to see it's not part of the API by now.
Mar 30, 2015
Adding my request for this. Working on a project which wishes to be able to restrict to a small range of countries; currently the API only allows a single country, or all. Neither is close to what we want.
Apr 1, 2015
Dear Google, Please have this in API.
Apr 7, 2015
Issue 4596 has been merged into this issue.
Apr 7, 2015
(No comment was entered for this change.)
Summary:
Autocomplete filter by multiple countries
(was: filter by multiple countries)
Owner: ---
Apr 7, 2015
Issue 5137 has been merged into this issue.
Apr 14, 2015
Issue 7888 has been merged into this issue.
Apr 24, 2015
Come on programmers, wake up!!
We need this:
componentRestrictions: {
country: ['us', 'ca']
}
Just change your query from '=' to 'in()', should not take more than 5 minutes.
May 4, 2015
Issue 7550 has been merged into this issue.
May 4, 2015
Issue 7538 has been merged into this issue.
May 4, 2015
Issue 5908 has been merged into this issue.
May 4, 2015
Issue 5596 has been merged into this issue.
May 4, 2015
Issue 5524 has been merged into this issue.
May 4, 2015
Issue 6871 has been merged into this issue.
May 4, 2015
Issue 6359 has been merged into this issue.
May 4, 2015
Issue 6481 has been merged into this issue.
May 5, 2015
I need this too. thx
May 5, 2015
it will be great if we have something like
componentRestrictions: {
country: ['us', 'ca']
}
May 6, 2015
Issue 7992 has been merged into this issue.
May 14, 2015
Please, we all nedd this!
May 16, 2015
I hoped that by now this feature will be implemented, last time I checked for this it was 2 years ago and still nothing, I don´t think this is something very hard to do unless you guys are dealing with extreme bureaucracy. please implement it
May 20, 2015
+1 I need to limit it to the United States and Canada. Can we at least get an update on this?
May 23, 2015
yes please...
May 28, 2015
Please this feature is badly needed !!!!
Jun 4, 2015
This bug is three years old, and has not made it past the "Acknowledged" status. Judging by the comments, there are a *lot* of people that require this feature. I should not have to issue two requests and merge their results just to handle this. Come on Google, get it together.
Jun 17, 2015
when is this going to be possible?
componentRestrictions: {
country: ['us', 'ca']
}
Jun 19, 2015
The fact that I cannot limit my google search to North America drives me crazy. I live in Canada & get a real lot of U.K. results. I don't want to limit my search to just Canada or just U.S. I just want my continent only - not overseas!
Jun 26, 2015
Can we get any official answer on this? It seems 3 years should be a long enough time to implement this?
Jul 6, 2015
Hi to anyone who has raised comments here - please add additional comments and with a bit of luck somebody at Google will get annoyed with getting their inbox full of the same issue and might do something about it. A response from Google would be appreciated - multiple choice options below to make it simple! a) won't do b) working on it, won't be long c) already done and waiting release...
Jul 7, 2015
Hey Gavin, while I understand your intent with your request to everyone who has starred this bug, I have to point out that we, as Googlers, have a policy of not commenting on future product direction. Deciding on future product direction is a collaborative effort between many different teams with different goals and stakeholder requirements. While filling up my inbox may impact me, it is the number of stars on an issue that the product managers really review when seeking guidance from our bug trackers. Thanks!
Jul 8, 2015
hi breetmor.... (googler), are 278 people who starred this issue in the last 3years not enough? ralf
Jul 8, 2015
Hi brettmor...: nice to hear from you! Apologies for the inbox filling incitement - was having a particularly frustrating day dealing with this issue in yet another project. If you sort the features list by number of stars, this is second on the list so obviously in high demand (after styled maps which is understandably more complex). I understand you don't want to reveal what you're working on, but do you think three years an acceptable length of time not to do anything with this issue? Is there an alternative channel to raise the priority on this one eg through our Maps-for-work account manager?
Jul 8, 2015
Hey Gavin, If you are a Maps for Work customer, by all means raise this as a ticket on the support portal. As to how product managers make decisions, I know they take into account the number of stars on an issue, but they also take into account other technical, product and business directions when making these engineering effort prioritization decisions. I share your (collective) frustration here, but I can't make promises on future product direction.
Jul 9, 2015
Would love to have this feature, thanks for all your hard work Brett!
Jul 13, 2015
Hi to all, Have just had a comment from Google via a Maps-For-Work request for this feature: "I am sorry to tell you that given the current backend, there is no plan to implement this feature." I guess we'll have to wait for them to update the backend then...
Jul 24, 2015
Issue 7204 has been merged into this issue.
Jul 31, 2015
Oh my god! This issue since 3 years ago :(
Aug 19, 2015
(No comment was entered for this change.)
Status:
Accepted
Aug 25, 2015
This is greatly needed for french overseas departments
Aug 25, 2015
Issue 6631 has been merged into this issue.
Aug 26, 2015
Issue 6517 has been merged into this issue.
Aug 26, 2015
Issue 6370 has been merged into this issue.
Sep 1, 2015
finally i got solution for this issue.. i hope this code will work..try this
**************************************************************
var input = document.getElementById('pac-input');
var options = {
types: ['(cities)'],
componentRestrictions: { country: 'in' }
};
var options1 = {
types: ['(cities)'],
componentRestrictions: { country: 'au' }
};
autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.addListener('place_changed', function () {
var place = autocomplete.getPlace();
var lat = parseFloat(place.geometry.location.lat()).toFixed(4);
var long = parseFloat(place.geometry.location.lng()).toFixed(4);
map.setView(new L.LatLng(lat, long), 18);
});
autocomplete = new google.maps.places.Autocomplete(input, options1);
autocomplete.addListener('place_changed', function () {
var place = autocomplete.getPlace();
var lat = parseFloat(place.geometry.location.lat()).toFixed(4);
var long = parseFloat(place.geometry.location.lng()).toFixed(4);
map.setView(new L.LatLng(lat, long), 18);
});
*************************
Cheers,
Kamaraj k
Sep 2, 2015
Three years and hundreds of stars later and this obviously needed feature hasn't made it in. Not very encouraging. Hopefully a competitor can do this.
Sep 13, 2015
I need this feature as well guys, why Google doesn't implement this?
Sep 21, 2015
Don't lose hope guys, this issues status is "accepted" since about one month. I guess Google is now working on that.
Sep 23, 2015
Issue 5224 has been merged into this issue.
Sep 24, 2015
Throwing hat in as yet another dev really needing this.
Sep 28, 2015
Issue 4221 has been merged into this issue.
Oct 6, 2015
Given the fact all overseas French territories are not included in the "France" geo search, we need this to give geographically & politically accurate responses to nation-wide queries in France.
Oct 13, 2015
can't believe that this isn't part of google maps api and hasn't bene addressed at all for so long!
Oct 13, 2015
I would like this feature
Nov 8, 2015
been waiting on this one too
Nov 10, 2015
I am also waiting for this feature !!
Nov 10, 2015
Need that too. Please implement!
Dec 1, 2015
Waiting for this, I want autocomplete for french locations, but DOM-TOM are excluded. This is very annoying because in fact they are part of France event they have their own ISO code. (GO, MQ...)
Dec 3, 2015
We have the same problem here, DOM-TOM are part of FR and we have no way of querying them for our french users.
Dec 9, 2015
I have the same need. Please make this asap
Dec 9, 2015
I am in need of this too.
Dec 10, 2015
European countries are small, I need it 5 in once!
Dec 10, 2015
When are they planning on integrating this?
Dec 12, 2015
bump :/
Dec 13, 2015
Same here I need it too
Dec 18, 2015
Yes we need it please!
Dec 23, 2015
Aaaaarg, damn it. I really need the fix. Guess they're not going to do it.
Dec 24, 2015
Another request for this feature, needing UK and Ireland with other countries to be added later.
Dec 24, 2015
Yes, plz
Dec 28, 2015
yes
Dec 29, 2015
A very useful feature. plz
Jan 3, 2016
Lol
Jan 11, 2016
Please, please do make his change! It is vital for a project I'm working on
Jan 25, 2016
please for FR and DOM-TOM !
Feb 9, 2016
Please do it
Feb 12, 2016
It could be Very Very useful ! Many clients ask me for this feature here : stern-taxi-fare.sternwebagency.com Thanks !
Feb 18, 2016
It would be useful if we can have filters on multiple countries like: components=postal_code:96799|country:US,AS where I can have the postal code of US and American Samoa
Feb 25, 2016
I don't know how complex this is to implement, but I see this is an incredibly old issue. I also need to be able to bias address autocomplete results to NA and not being able to do this with an option parameter makes me work on a freaking huge bounding rectangle to be able to receive the results I need. Hopefully, this will be implemented soon. Being able to restrict/bias search results by multiple countries (with priority) or continent, will be very useful.
Mar 7, 2016
I'm voting for this as well!
Mar 9, 2016
I need this too !
Mar 17, 2016
I've posted a workaround to Stackoverflow: http://stackoverflow.com/questions/11290755/limit-google-maps-of-countries-in-the-autocomplete-list-to-india-usa-and-uk/36064059#36064059
Mar 22, 2016
The above workaround does work although it should have credited the original author http://mrruben.be/tech/gmaps-autocomplete-countries/
Apr 3, 2016
om namah shivay
Apr 14, 2016
Hurry up Google !
May 3, 2016
4 years and still nothing?? comeon google! Very useful feature.
May 3, 2016
4 years and still nothing?? comeon google! Very useful feature.
May 6, 2016
This would indeed be very useful, if only I could filter on multiple countries. Simply like:
autocomplete = new google.maps.places.Autocomplete(
(document.getElementById('autocomplete')), {
types: ['geocode'],
componentRestrictions: { country: ['nl', 'de', 'fr', 'de']}
}
May 10, 2016
Need that feature so much!
May 11, 2016
I need this
May 11, 2016
is there any update on this????
May 25, 2016
Is there any estimated timeline for when we can expect this feature?
May 26, 2016
This is my workaround (uk and ireland), it works fine for me but I had to disable location selections by arrow key, feel free to improve it http://stackoverflow.com/a/37386426/4237893
May 26, 2016
Not that it matters at this point, but +1 for this. (US + CA is pretty common usecase)
Yesterday (39 hours ago)
Come-on Google, its been too long. |
|
| ► Sign in to add a comment |