开发者

Google Autocomplete service for places (cities, countries, not establishment such as business)

开发者 https://www.devze.com 2023-04-11 07:30 出处:网络
I need to offer in my application the ability to predict (auto suggest) places, as user typing. I know that Google have such service. The iss开发者_如何学Goue is, Google Autocomplete service predict p

I need to offer in my application the ability to predict (auto suggest) places, as user typing. I know that Google have such service. The iss开发者_如何学Goue is, Google Autocomplete service predict places (business) while I need to autocomplete, places, such as cities, countries (not establishment such as business). Does Google or others offer this service?

thanks,,


If you are talking about Javascript:

Link to Docs

Yes, set the types to geocode and it will only give suggestions to places, and not businesses.

var acOptions = {
  bounds: ACdefaultBounds,
  types: ['geocode']
};

var input = document.getElementById('searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input, acOptions);
0

精彩评论

暂无评论...
验证码 换一张
取 消