Boosa Ramesh
Boosa Ramesh

Reputation: 389

How to get list of bus stations in between the source and destination with GOOGLE MAPS IN iOS Swift

Hello every one I am working with Google maps, I have a requirement to show list of bus stops in between the source and destination within the city. I tried my best but I am not able to get the result. Please help me on this.

Hi all i am using below api but not getting list of bus stations between the source and destination "https://maps.googleapis.com/maps/api/directions/json?origin=Raidurg‌​am Bus Stop, Old Mumbai Highway, Madhura Nagar Colony, Gachibowli, Hyderabad, Telangana 500032&destination=Mehdipatnam Bus Stop, Mehdipatnam Road, Santosh Nagar, Mehdipatnam, Hyderabad, Telangana 500028&mode=transit&types=bus_station&key= API_KEY"

THANKS IN ADVANCE

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

    })

Upvotes: 2

Views: 753

Answers (1)

MAhipal Singh
MAhipal Singh

Reputation: 4827

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

parameters

radius-->Distance_Between_Source_Destination in meter.

location-->Source_lat_long.

Upvotes: 1

Related Questions