谷歌地图transit_station还显示公交车站 [英] Google maps transit_station also shows bus stations

查看:262
本文介绍了谷歌地图transit_station还显示公交车站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在地图上显示所有的麦德龙停靠站和火车停靠站。我正在通过



希望它有帮助!


I'm trying to display all METRO STOPS and TRAM STOPS on a map. I'm doing so via the Radar Search API. It gives back all locations matching a type within a given radius. These types are possible.

So I'm basically doing a search on the types subway_station for metro and transit_station for tram stops.

The problem is that transit_station also returns bus stations (which also has its separate type bus_station so I would expect them not to be returned via the transit_station type).

This is the URL I'm making the request to:

https://maps.googleapis.com/maps/api/place/radarsearch/json?type=transit_station&location=51.055154,3.726752&radius=5000&key=[MY_API_KEY]

So I wonder if I'm doing something wrong or my request is simply not possible via Google Maps?

解决方案

My understanding is that transit_station is a generic type that includes train_station, bus_station, subway_station and light_rail_station.

I think you should use a separate light_rail_station type for trams:

https://maps.googleapis.com/maps/api/place/radarsearch/json?location=51.055154%2C3.726752&radius=5000&type=light_rail_station&key=YOUR_API_KEY

Also, I figured out that many stations are marked as a bus_station and light_rail_station at the same time.

Hope it helps!

这篇关于谷歌地图transit_station还显示公交车站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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