Places Autocomplete Service

AutocompleteService class

google.maps.places.AutocompleteService class

包含與擷取自動完成預測結果相關的方法。

撥打 const {AutocompleteService} = await google.maps.importLibrary("places") 即可存取。
請參閱「Maps JavaScript API 中的程式庫」。

AutocompleteService
AutocompleteService()
參數:
建立 AutocompleteService 的新例項。
getPlacePredictions
getPlacePredictions(request[, callback])
參數: 
根據提供的自動完成要求,擷取地點自動完成預測結果。
getQueryPredictions
getQueryPredictions(request, callback)
參數: 
傳回值:
根據提供的查詢自動完成要求,擷取查詢自動完成預測結果。

AutocompletionRequest 介面

google.maps.places.AutocompletionRequest 介面

要傳送至 AutocompleteService.getPlacePredictions 的自動完成要求。

input
類型:  string
使用者輸入的字串。
bounds optional
類型:  LatLngBounds|