Geocomplete cities without country information in gecomplete

45 Views Asked by At

am using Google Geocomplete to auto suggest my visitors when typing in citie

It works well, but however it suggests country next to the city. For example, if i start to type Chennai, it will suggest Chennai,TamilNadu,India. I need only Chennai, without the country.

Does somebody know how to tell Geocomplete to show only cities without the country?

Thanks

1

There are 1 best solutions below

1
Brian On

The code from here: Only list the cities name Geocomplete.js or Google Location Autocomplete

  var options = {
              types: ['(cities)'],
              componentRestrictions: {}
          };

     $("#source").geocomplete(options);