Google 地点自动完成 API - 输入时缩写基本方向

Google Places Autocomplete API - Abbreviate Cardinal Direction on input

我正在使用 Google Places Autocomplete 来查找地址,我希望用户能够在他们的街道地址中输入主要方向的缩写。

例如,我的用户必须完全键入“north”(例如 123“north”willow lane),而不仅仅是“n”(例如 123“n”willow lane)。大多数时候,用户会尝试键入“n”、“s”、“e”、“w”,并认为我们的自动完成功能已损坏,因为自动完成功能需要输入完整的基本方向。

在 API 的地方是否有切换此配置的设置?子串匹配?

https://developers.google.com/maps/documentation/places/web-service/autocomplete#PlaceAutocompleteMatchedSubstring


这是我当前的代码:

我正在使用 Javascript。

导入自动完成:

  async mounted() {
    const maps = await this.$GMaps()
    this.autocompleteService = new maps.places.AutocompleteService()
  },

使用自动完成获取预测:

this.autocompleteService.getPlacePredictions({ input: searchAddress }, (predictions) => {
        this.addressPredictions = predictions
      })

(我正在使用 Nuxt/Vue)

这与 google 自动完成无关。 Console.logging 显示返回的结果带有缩写的基本方向。

相反,这是 Vuetify 的 v-autocomplete 过滤掉所需建议的问题。可以使用“no-filter”属性配置 V-autocomplete 以显示这些结果