Jump to content

Customize Address Field


sobrenome

Recommended Posts

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);

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...