如何制作“你的意思是”吗?谷歌地图 API 中的建议链接?
我正在尝试使用 google 地图 api 制作一个网络应用程序,以提供指示。现在,它可以很好地提供指示,除非用户输入错误的内容,它要么不显示任何内容,要么尝试找出答案并给出错误的地址。我想提供这样的功能:如果地址无法识别,它会显示“您的意思是”,然后提出与您尝试输入的内容接近的建议。我在谷歌代码中找不到任何谈到这一点的内容,但我想知道是否有人知道这是否可能,以及我该怎么做?
谢谢!
I'm trying to make a web application with google maps api, that gives directions. Right now, It gives directions fine unless the user types in something wrong, it either doesn't show anything or it tries to figure it out and gives the wrong address. I want to make functionality where if the address is not recognized it has "did you mean" and then make a suggestion that's close to what you were trying to enter. I couldn't find anything in the google code that talked about that, but I'm wondering if anyone knows if it's possible, and how I can do it?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅当提供给 loadFromWayPoints() 的输入映射到地球上的任何确定点时,loadFromWayPoints() 才会绘制折线。您可以通过以纬度和经度形式(而不是地址)固定出发点来避免操作混乱。然后使用以下函数,您可以创建如果为 toInput 返回多个点,您的意思是 To 点吗?
代码是不言自明的。如果你不明白。在评论中回复。
您想要绘制的点之一应该从谷歌地理编码器系统返回明确的点。
在我的例子中,我使用起始点作为确定点。并让它与我协调。所以没有机会获得
loadFromWayPoints() draws polyline only if the inputs provided to it maps to any definite point on the earth. You can avoid the confusion to function by fixing your from point in form of latitude and longitude, instead of address. Then using following function you may create Did you mean for To point if multiple points returned for toInput.
Code is self explanatory. If you dont understand. Reply in comment.
One of the point you want to plot should return definite point from google geocoder system.
In my I used the from point as definite point. And had it coordinates with me. So there is no chance of getting