Home - AlphaCenturies/AlphaCenturiesA GitHub Wiki

Welcome to the AlphaCenturiesA wiki!

  1. Data come from the TrackBus server.
  2. calculate how to get to the station.

https://www.youtube.com/watch?v=rVmxXpI28zU

I don't think Google offers a standlone traffic API as of now. However there are a couple options.

Render the Google Maps element in a WebView and use the Google JavaScript API to enable the traffic layer. The downside of this approach is that the UX likely wont be as nice as native programming. The upside is less coding. http://code.google.com/apis/maps/documentation/javascript/

http://code.google.com/apis/maps/documentation/javascript/reference.html#TrafficLayer

Call another traffic provider's REST API and overlay on top of the native iOS map component. This overlay is pretty straightforward through code if you get a KML response. The two I know of are MapQuest (yes, they are still around!) and Yahoo (though their API is in transition now). http://www.mapquestapi.com/traffic/

http://developer.yahoo.com/traffic/rest/V1/index.html

Unlike Apple's MapKit, the Google Maps SDK for iOS does not natively include a way to perform route calculations.

Instead, you need to use the Google Directions API: https://developers.google.com/maps/documentation/directions/. It is an HTTP-only API, and Google does not provide any SDK as of today, but you can easily write your own wrapper yourself, or choose one of the many options available on Github:

https://github.com/sdpjswl/ASJGooglePlaces (ASJDirectionsAPI) https://github.com/sebk/GoogleDirections https://github.com/iamamused/iOS-DirectionKit https://github.com/marciniwanicki/OCGoogleDirectionsAPI and many others...

You'll need to call the Place Search with the type set to bus_station to limit the return to that specific type. The response will return results with their details that you can use to set the Markers. (get bus station)