我创建了一个智能公共交通应用程序,并尝试从Google获取有关公交车站的数据。我可以很容易地找到最近的公交车站,公交车我还需要看看那些公交车站有哪些公交车(公交线路)。
Google表示Places API中有一些 transit_details ,但我不知道如何在获得最近的公交车站后获得这些 transit_details 。
https://developers.google.com/maps/documentation/directions/intro#TransitDetails
这是关闭巴士站的请求的对象:
{
geometry: {
location: {
lat: 46.77649719999999,
lng: 23.6280244
},
viewport: {
northeast: {
lat: 46.7778461802915,
lng: 23.6293733802915
},
southwest: {
lat: 46.7751482197085,
lng: 23.6266754197085
}
}
},
icon: "https://maps.gstatic.com/mapfiles/place_api/icons/bus-71.png",
id: "86e66fd8a89d6aec0b9cc59e7ca14c08e6d92076",
name: "Strada Siretului",
place_id: "ChIJQZ3PtGwMSUcRAYCfYNJak48",
rating: 5,
reference: "CmRSAAAAjklKtNRZscODDtwcPoR5L79IdJoMyMFprmOyz3rEY2-0gPoTMhFPP7FGjO7n6T53hSjrs38DIxcqXcXOnT8OLSIrb4Q05lI6BdEOWMp_A0zkmSLtvHZqmFouvS5sMQ-yEhCxv-VOUO5PGIFOqZcmbOCPGhQRot14-a4Ng1CJYkwD35VBi5djfA",
scope: "GOOGLE",
types: [
"bus_station",
"transit_station",
"point_of_interest",
"establishment"
],
vicinity: "Cluj-Napoca"
}
如何查看电台可用的公交线路?