sobrenome Posted November 9, 2015 Posted November 9, 2015 How to customize Address Field to set a different default country and to add the states of this new default country?
sobrenome Posted November 13, 2015 Author Posted November 13, 2015 I am using the community enhancement "Google Places" for autocomplete address field. So I suppose that I should change google code to set a different default country to allow its states to be exhibited. I checked on https://developers.google.com/maps/documentation/javascript/places-autocomplete to see if there is a way to change the default country, but could not find anything related to that. Has anyone found a solution for this? Well, I guess that the anwser is here: Set biases and search-area boundaries for Autocomplete You can bias the autocomplete results to favor an approximate location or area, in the following ways: Set the bounds on creation of the Autocomplete object. Change the bounds on an existing Autocomplete. Set the bounds to the map's viewport. Restrict the search to a specific country. Details are in the sections below. Note: If you do not supply any bounds or a map viewport, the API will attempt to detect the user's location from their IP address, and will bias the results to that location. If you would prefer to have no location bias, set the bounds to encompass the whole world: (-90,-180),(90,180). Could anyone help me to find this file in IPS 4 to change: var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-33.8902, 151.1759), new google.maps.LatLng(-33.8474, 151.2631)); var input = document.getElementById('searchTextField'); var options = { bounds: defaultBounds, types: ['establishment'] }; autocomplete = new google.maps.places.Autocomplete(input, options);
Recommended Posts
Archived
This topic is now archived and is closed to further replies.