ios - 如何在 iOS Swift 中使用 GOOGLE MAPS 获取源和目的地之间的公交车站列表

标签 ios google-maps swift2 google-places-api

大家好,我正在使用 Google map ,我需要显示城市中源和目的地之间的公交车站列表。我尽力了,但我无法得到结果。请帮我解决这个问题。

大家好,我正在使用下面的 api,但没有获取源和目的地之间的公交车站列表 "https://maps.googleapis.com/maps/api/directions/json?origin=Raidurg am 巴士站,旧孟买公路,Madhura Nagar Colony,Gachibowli,Hyderabad,Telangana 500032&destination=Mehdipatnam 巴士站,Mehdipatnam Road,Santosh Nagar,Mehdipatnam,Hyderabad,Telangana 500028&mode=transit&types=bus_station&key= API_KEY"

提前致谢

dispatch_async(dispatch_get_main_queue(),{

        let path = GMSPath(fromEncodedPath: rout)
        let polilin = GMSPolyline(path: path)
        polilin.strokeWidth = 4.0
        polilin.map = self.mapView
        polilin.tappable = true
        var bounds = GMSCoordinateBounds()
        for index in 1...path!.count() {
            bounds = bounds.includingCoordinate(path!.coordinateAtIndex(index))
        }
        self.mapView.animateWithCameraUpdate(GMSCameraUpdate.fitBounds(bounds))
        self.mapView.trafficEnabled = true

    })

最佳答案

https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=API_KEY&location=source_lat_long&radius=500&types=bus_station

参数

半径-->以米为单位的 Distance_Between_Source_Destination。

位置-->Source_lat_long。

关于ios - 如何在 iOS Swift 中使用 GOOGLE MAPS 获取源和目的地之间的公交车站列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40926637/

相关文章:

ios - 在 iOS 设备上显示基于 Flash 的 youtube 视频

javascript - 使用 Google map 触发标记和标记簇上的点击事件

google-maps - 2个GPS坐标之间的线的功能

ios - Swift 覆盖协议(protocol)扩展保持扩展行为

ios - 我有这个错误 "canOpenURL: failed for URL :com.appcoda.gsignin"

ios - 对 iPhone 6+ 的@3x 图稿感到困惑

ios - 如何从不同的 segues 中表现不同?

ios - 在 UICollectionView 或 UITableView 中实现粘性单元格

google-maps - 自定义 Flutter Google Map 中的中心位置按钮

ios - 如何从我们的应用程序在 WhatsApp 中打开特定联系人的聊天屏幕?