Google 地点搜索结果

Google Places Search Results

我正在使用 google 的地方 API 来搜索某些商店。

以名为'Sangkaya'的分店为例(注:Sangkaya是一家冰淇淋专营店),当我输入以下查询时,返回了8个Sangkaya分店。

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=3.081213,101.5844108&radius=50000&type=store&keyword=sangkaya&key=YourAPIKey

在上面的查询中,我将 'store' 传递给类型参数,将 'sangkaya' 传递给关键字参数。

然而,当我使用下一个查询时,我仍然将 'store' 传递给类型参数,但没有将 'sangkaya' 传递给关键字参数,查询结果不包含任何 Sangkaya 网点:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=3.081213,101.5844108&radius=50000&type=store&key=YourAPIKey

每个出口的 'types' 键中包含的值包含值 'store'。

我的问题是,为什么在第二个查询中没有返回 8 个 Sangkaya 分店?

你的第二个查询没有return Sangkaya网点因为它没有理由return他们,它只是returns "stores" 3.081213,101.5844108 50公里以内无特别偏好。

如果您想找到最近的结果,请将 rankby=distance 与类型或关键字一起使用,并注意最大半径为 7000 米。