You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何初始化Mapbox JS Autofill仅返回完整地址?

Mapbox JS Autofill 仅返回完整地址的配置方法

要让Autofill组件只返回包含完整信息的地址(排除仅街道、高速公路这类道路级结果),只需在初始化配置中添加types选项,指定仅匹配address类型:

autofillCollection = mapboxsearch.autofill({
    options: { 
        country: 'us',
        language: 'en',
        types: ['address'] // 过滤仅保留完整地址结果
    }
});
  • types参数用于限定返回结果的类型,['address']会让组件只返回带有门牌号、完整街道及城市信息的地址条目,自动排除仅道路名称的匹配项。

内容的提问来源于stack exchange,提问作者Tim Nuwin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 06:20:40