做“沿着路线的兴趣点”在谷歌地图 [英] doing "points of interest along a route" in google maps

查看:313
本文介绍了做“沿着路线的兴趣点”在谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要允许旅行者使用谷歌地图来绘制路线,然后查询我感兴趣的地点数据库(比如麦当劳的位置),然后显示所有位于路线一英里或两英里内的地点他们将会采取。问题是,如何有效地从谷歌(基本上是经纬度/长对数组)返回驾车路线信息,然后将其转换为SQL查询以获取距离路线一定距离内的位置?



它不一定要非常精确,而且因为飞鸟距离路线很近。我最关心的是它的效率是否合理。

在数据库中,每个条目都有一个经度和纬度,基本上都是基本设置的,但是我可以更改数据库架构。



作为一个例子,这个网站做我想做的事情(如果你给出了一个起点和终点,它将显示雪佛龙站是在您将要采取的高速公路附近):
http:// www。 chevron.com/products/stations/stationfinder/planyourroute.aspx



http://karmatics.com/docs/locationsalongroute.png

解决方案

检查this out



http:// google-maps-utility-library -v3.googlecode.com/svn/tags/routeboxer/1.0/examples/routeboxer-v3.html



以下是文档: http:// google-maps-utility-library- v3.googlecode.com/svn/tags/routeboxer/1.0/docs/examples.html



您可以从RouteBoxer获取框坐标并将其发送给用于处理的服务器端脚本


I need to allow travelers to use google maps to plot a route, and then query my database of points of interest (let's say, McDonald's locations) and then show all of these locations that are within a mile or two of the route they will be taking. The question is, how do I efficiently take the "driving directions" information that comes back from google (essentially an array of lat/long pairs), and turn that into an sql query to get locations that fall within a certain distance from the route?

It does not have to be super precise, and "as the bird flies" distances from the routes are just fine. I'm most concerned about it being reasonably efficient.

In the database, things are set up pretty basically with each entry having a latitude and longitude, but I can change the database schema as needed.

As an example, this site does what I want to do (if you give a starting point and ending point, it will show chevron stations that are near the highway you will be taking): http://www.chevron.com/products/stations/stationfinder/planyourroute.aspx

http://karmatics.com/docs/locationsalongroute.png

解决方案

Check this out

http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/examples/routeboxer-v3.html

Here's the documentation: http://google-maps-utility-library-v3.googlecode.com/svn/tags/routeboxer/1.0/docs/examples.html

You could get the box coordinates from RouteBoxer and send that to a serverside script for processing

这篇关于做“沿着路线的兴趣点”在谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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