谷歌地图API搜索返回意想不到的结果 [英] Google maps api search returns unexpected results

查看:112
本文介绍了谷歌地图API搜索返回意想不到的结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用示例代码: https://developers.google。 com / maps / documentation / javascript / examples / places-searchbox



我发现当我输入:DePaul University
然后选择第三其中一个:美国伊利诺伊州芝加哥北肯莫尔大道的德保罗大学实际上它给我一个名为德保罗大学戏剧学院的地方,我宁愿在那里得到只有DePaul大学才是文本框中的粗体。



当我输入:Herzing University
然后选择:Herzing University Madison,Madison, WI,美国



它给我留下了很多地方......其中许多是大学附近的酒店。 (???)

解决方案

使用 Places-Autocomplete 改为

Using the example code at: https://developers.google.com/maps/documentation/javascript/examples/places-searchbox

I find that when I type: DePaul University and then choose the third one: DePaul University, North Kenmore Avenue, Chicago, IL, United States

it actually returns me a place named "The Theater School at DePaul University" where I would prefer getting just "DePaul University" which was what was bolded in the textbox.

Also when I type: Herzing University and then choose: Herzing University Madison, Madison, WI, United States

It returns me many places... many of them hotels around the university. (???)

解决方案

Use the Places-Autocomplete instead

这篇关于谷歌地图API搜索返回意想不到的结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆