I'm currently implementing a Google Places search feature and I need to enable "Location Biasing" for the GCC countries (UAE, Saudi Arabia, Oman, Kuwait & Bahrain).
My goal is to achieve the functionality described in the following link: https://developers.google.com/maps/documentation/places/autocomplete#location_biasing
I want to offer Google Places search within a textbox where users will exclusively see results from the countries UAE, Saudi Arabia, Oman, Kuwait & Bahrain.
Thank you,
Currently, I can implement "Location Bias" for one country using the "componentRestrictions" parameter as demonstrated in the code snippet below:
var mapOptions = {
//bounds : defaultBounds,
center: new google.maps.LatLng(25.2644444, 55.31166669999993),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
var input = document.getElementById('searchTextField');
var InputOptions = {
types: ['(cities)'],
**componentRestrictions: { country: 'AE' } // I want multiple countries here**
};
var autocomplete = new google.maps.places.Autocomplete(input, InputOptions);
However, I am seeking to implement Location Biasing for multiple countries that I have mentioned above.