如果您只需要在用户没有从“地点自动完成”列表中选择地点时什么都不做,那么您可以简单地执行以下操作: autocomplete.addListener('place_changed', function() { var place = autocomplete.getPlace(); if (!place.geometry) { // User entered the name of a Place that was not suggested and // pressed the Enter key, or the Place Details request failed. return; } // If the place has a geometry, then present it on a map. if (place.geometry.viewport) { map.fitBounds(place.geometry.viewport); } else { map.setCenter(place.geometry.location); map.setZoom(17); } });