获得的谷歌地图标记坐标 [英] Get coordinates of Google Maps markers
问题描述
我创建包含的名称和坐标DATABSE的所有公交车在我的本地区域停止。我有存储在我的数据库中的所有名字,现在我需要添加坐标。我想获得一个包含所有这些作为对谷歌地图的地标一个网站的这些。像被从本地服务器生成它们,然后添加到地图似乎我。但是我无法准确找到所在的服务器查询坐标。
I am creating a databse containing the names and coordinates of all bus stops in my local area. I have all the names stored in my database, and now I need to add the coordinates. I am trying to get these of a website that contains them all as placemarks on a Google Map. It seems to me like they are being generated from a local server, and then added to the map. However I am unable to find exactly where the server is queried for the coordinates.
我希望通过使用屏幕刮刀来收集这些坐标。不过,除非我能找到的地方源$ C $ C坐标创建这似乎是不可能的。我当然可以搜索和手动收集所有这些地标,但将是非常费时。因此,我希望有人这里能帮助我。
I am hoping to collect these coordinates through the use of a screen scraper. However unless I am able to find where in the source code the coordinates are created this seems to be impossible. I can of course search and collect all these placemarks manually, but that will be very time consuming. So I am hoping that someone in here can help me.
这是我想刮网站。地标是由蓝色巴士的标志标明:
This is the website I am trying to scrape. The placemarks are marked by the blue bus sign:
<一个href=\"http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/?from=Brimnes+ferjekai+%28Eidfjord%29&to=\" rel=\"nofollow\">http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/?from=Brimnes+ferjekai+%28Eidfjord%29&to=
您也可以通过写在搜索领域的停止的名称,并力推可见我跑跑卡丁车按钮获取单个标的的坐标。
You can also get the coordinates of a single placemark by writing the name of the stop in the search field and pushing the "Vis i kart" button.
我希望有人能帮助我。
推荐答案
在与萤火虫检查,看来你提到该网站是在用简单的AJAX请求,如XML格式获取数据:
On checking with Firebug, it appears that the site you mentioned is getting the data in XML format with simple AJAX requests such as:
<一个href=\"http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/mapxml?x1=4.85321044921875&x2=5.8282470703125&y1=60.150391714056326&y2=60.524184817591276&loc=1\" rel=\"nofollow\">http://reiseplanlegger.skyss.no/scripts/travelmagic/TravelMagicWE.dll/mapxml?x1=4.85321044921875&x2=5.8282470703125&y1=60.150391714056326&y2=60.524184817591276&loc=1
的(X1,Y1),(X2,Y2)的参数定义(经度,纬度)视口的参数。每次地图上拖动,一个新的AJAX请求发出后,返回新的数据。
The (x1, y1), (x2, y2) parameters define the (longitude, latitude) parameters of the viewport. Everytime the map is dragged, a new AJAX request is issued, which returns fresh data.
这是从AJAX请求的响应示例:
This is a sample response from the AJAX request:
<stages>
<i n="Arna Stasjon Togstopp (Bergen)" sn="" v="12019888" t="2" i="0" x="5,465809" y="60,420116" sp="" st="Tog.GIF"/>
<i n="Arna Terminal (Bergen)" sn="" v="12014200" t="2" i="0" x="5,464333" y="60,420319" sp="" st="Buss.GIF"/>
<i n="Bjørkheim Ved Senter (Samnanger)" sn="" v="12426607" t="2" i="0" x="5,730484" y="60,402178" sp="" st="Buss.GIF"/>
<i n="Bjørkheim Ved Senter (Samnanger)" sn="" v="12426608" t="2" i="0" x="5,731842" y="60,401312" sp="" st="Buss.GIF"/>
<i n="Breistein Ferjekai (Bergen)" sn="" v="12017399" t="2" i="0" x="5,399175" y="60,490519" sp="" st="Ferge.GIF"/>
<i n="Eikelandsosen Terminal (Fusa)" sn="" v="12410510" t="2" i="0" x="5,747773" y="60,241479" sp="" st="Buss.GIF"/>
</stages>
请注意, X
属性定义经度,而是
属性定义纬度。
Note that the x
attribute is defining the longitude, while the y
attribute is defining the latitude.
除了技术性的回答,我会建议刮这样的数据面前寻求许可。
Apart from the technical answer, I would suggest seeking permission before scraping such data.
这篇关于获得的谷歌地图标记坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!