2
你好我有一个问题与谷歌放置自动完成API。我期待拥有它,因此用户只能搜索大学。这可能吗?这是我当前的代码:谷歌地方自动完成API限制只有大学
//Limits search results to only us places.
var options = {
types: ['university','establishment'],
componentRestrictions: {country: "us"}
};
var input = document.getElementById('searchTextField');
autocomplete = new google.maps.places.Autocomplete(input, options);
google.maps.event.addListener(autocomplete, 'place_changed', function() {
<?php if($this->uri->segment(1)=='0')
{ ?>
$('.advanced_search').show();
<?php } elseif($this->uri->segment(2)=='edit') { ?>
$('.advanced_search_rooms').hide();
<?php }