“最近的餐馆定位器”的地理定位
对于在线订购系统,我们认为我们将获取输入的地址和城市,使用 Google Maps API 计算它与地址数据库中每个条目之间的距离。
然而,客户的前任设计师告诉他,他需要使用地理定位来提高准确性。据我所知,地理定位只能准确获取用户的国家/地区,但绝对不能准确获取位置。
地址+城市的方式有问题吗?地理定位方法是否真实?
For an online ordering system, we figured that we would take the entered address and city, calculate the distance between it and each entry in a database of addresses using the Google Maps API.
However the client was told by his previous designer that he needs to use geotargeting for more accuracy. As far as I know, geotargetting is only accurate in getting the user's country, but definitely not precise location.
Is there a problem with the address+city method? And is there any truth to the geotargetting method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果用户选择共享,地理定位将为您提供用户的精确位置(坐标)。
您可以使用 Google Maps API 的坐标,然后按照您计划的用户或餐厅地址的相同方式计算距离。 (谷歌在计算中将任何地址转换为坐标。)
地址+城市方法没有问题,但用户可能更容易分享他们当前的位置......而不必输入当前地址+城市。
如果用户不愿意通过地理定位“共享当前位置”,则需要使用地址+城市作为后备方案。
Geo-targeting will provide you with the precise location (coordinates) of the user, if they choose to share it.
You can use the coordinates with Google Maps API to then calculate the distance in the same manner you planned with address of the user or the restaurant. (Google converts any address to a coordinates in it's calculations.)
There is no problem with your address+city method, but it may be easier for users to just share their current location... and not have to enter a current address+city.
Address+city would need to be a fallback if the user is not willing to 'share their current location' via geo-targeting.