mapbox geocoder API 是否可以在没有地图的情况下使用?

Is mapbox geocoder API available for usage without a map?

我正在通读 mapbox JS api,但似乎没有找到任何地理编码 API 调用,使我能够使用自己的预输入组件提供地点查找。所以基本上我是在发出查询并收到一系列结果之后。

不是 指的是 how to place geocoder Control on or off the map 上的示例,而是我如何以我自己的形式提供地点查找 [Angular、React 等等] 不显示任何地图。这可能吗?

这显然违反了Mapbox's terms of service:

You may only use responses from the Geocoding API ("Geocodes") in conjunction with a Mapbox map.

这就是 mapbox-gl-js MapboxGeocoder control (which consumes Mapbox Geocoding API) 仅与 Mapbox 地图结合使用的原因,这意味着您的场景 受支持。

[2020 年 5 月更新]

Mapbox now does allow you to use a Geocoder without using a map(自动完成搜索表单)

July 1, 2019: Removed the default restriction that Services have to be used in conjunction with a Mapbox map. Point of interest results from the Geocoding API and Enterprise Boundaries must still be used in conjunction with a Mapbox map.

可以找到示例 from the Mapbox website and from Mapbox Github page

您可以使用此 shows an alternative plugin/ service called Algolia 创建地理编码器。

另一种选择是使用 Geocodio

但是,Geocodio 和 Mapbox Geocoder(没有地图支持 POI(兴趣点) 例如。一个命名的地方,包括商业企业、public 建筑物、纪念碑和公园等

希望这对以后的人有所帮助!

2019 年 7 月 1 日:删除了服务必须与 Mapbox 地图结合使用的默认限制。来自地理编码 API 和企业边界的兴趣点结果仍必须与 Mapbox 地图结合使用。