0

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

  • Use the [Autocomplete Service](https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service) from the Maps API v3 and build your own suggestions list. – MrUpsidown Aug 19 '19 at 08:50

1 Answers1

0

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

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

     $("#source").geocomplete(options);
Brian
  • 117
  • 4