Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/445.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 活动的目的是什么;“放置搜索框”;在谷歌的地方API?_Javascript_Google Maps_Google Places Api - Fatal编程技术网

Javascript 活动的目的是什么;“放置搜索框”;在谷歌的地方API?

Javascript 活动的目的是什么;“放置搜索框”;在谷歌的地方API?,javascript,google-maps,google-places-api,Javascript,Google Maps,Google Places Api,我正在使用谷歌地图JavaScript API 对于从google.maps.places.SearchBox(document.createElement('nameforeElement')返回的对象,是否存在除“places\u changed”事件以外的任何事件 您可以在本例中看到位置搜索框 最后,我需要做的是在单击搜索框时清除它。但是我认为这个搜索框没有“点击”事件。捕捉点击事件的正确关键词是什么?”鼠标单击“,”单击“,”再次单击“…?” 将单击侦听器添加到中 对于链接示例,它将是:

我正在使用谷歌地图JavaScript API

对于从google.maps.places.SearchBox(document.createElement('nameforeElement')返回的对象,是否存在除“places\u changed”事件以外的任何事件

您可以在本例中看到位置搜索框


最后,我需要做的是在单击搜索框时清除它。但是我认为这个搜索框没有“点击”事件。捕捉点击事件的正确关键词是什么?”鼠标单击“,”单击“,”再次单击“…?”

将单击侦听器添加到

对于链接示例,它将是:

  // Create the search box and link it to the UI element.
  var input = document.getElementById('pac-input');
  var searchBox = new google.maps.places.SearchBox(input);

  google.maps.event.addDomListener(input,'click',function(){
    this.value='';
  });

你是用js还是安卓系统?