How to integrate GTFS-realtime data with Directions service - Google map javascript API? - google-maps

Direction service API doesn't list any option to include GTFS-realtime data. Here is the link for that API - https://developers.google.com/maps/documentation/javascript/directions
Is there any way by which we can pass parameters to DirectionsRequest object and get GTFS-real time data with the result ?

Related

google maps javascript is fetching the route but not the json api

I have stumbled upon this: when I use directionsDisplay.getDirections() API to fetch and display the results, it works, but when I do it via json:
https://maps.googleapis.com/maps/api/directions/json?origin=place_id:ChIJR0FT51wiDogRNuVKiLn9ZLA&destination=place_id:ChIJMWaiY0YpTIYRRdGvCMg7m0g&key=MY_KEY&waypoints=via:place_id:ChIJaWS37r88DIgRu-ak1l7eXAQ
I get "status" : "ZERO_RESULTS"
I am wondering why this might be happening? Any ideas?
Remove the "via:" keyword from the waypoints to get the response.
https://maps.googleapis.com/maps/api/directions/json?origin=place_id:ChIJR0FT51wiDogRNuVKiLn9ZLA&destination=place_id:ChIJMWaiY0YpTIYRRdGvCMg7m0g&key=MY_KEY&waypoints=place_id:ChIJaWS37r88DIgRu-ak1l7eXAQ
From the documentation:
The via: prefix is most effective when creating routes in response to the user dragging the waypoints on the map. Doing so allows the user to see how the final route may look in real-time and helps ensure that waypoints are placed in locations that are accessible to the Google Maps Directions API.
Caution: Using the via: prefix to avoid stopovers results in directions that are very strict in their interpretation of the waypoint. This may result in severe detours on the route or ZERO_RESULTS in the response status code if the Google Maps Directions API is unable to create directions through that point.

Is GTFS-realtime data in Google Maps Directions API

I would like to know:
Is GTFS-realtime data available from the Google Maps Directions API?
If not, are there plans to include GTFS-realtime data in the Google Maps Directions API?
I am a member of a team developing a web application that integrates Google Maps Directions API. The website provides a "Trip Planner" form in which the user enters From, To, Date, and time data to display trip options into the website. Our website visitors are specifically interested in Bus transit options.
The integration is working wonderfully. However, the data returned by the Google API does not contain GTFS-realtime data. We know that the realtime is known to Google through GTFS feeds provided by the transit provider, and we see the realtime data when doing an identical search via https://www.google.com/maps.
I looked at the "Transit Specific Information" that is returned in the Google Maps API DirectionsResult Object (https://developers.google.com/maps/documentation/javascript/directions#TransitInformation). There is no reference to real-time information in this documentation. Even if real-time information is supplied (and I suspect that it is not), there would be no way to distinguish between scheduled and predicted times.

Is it possible to get multiple routes available between 2 places using google map api v3

I am new to Google map API and Phonegap. I am trying to create an app which will show the possible routes between the origin and destiny.
So is it possible to get multiple routes with direction using Google map API.
Is there any other API apart from Google which will provide me the multiple route. Thanks in advance.
The DirectionsRequest query has a boolean parameter provideRouteAlternatives that returns alternate routes in the DirectionsResult object.
Here is the documentation on working with the Directions Service:

Google Places API and Destination URL

Is there a way to get a place's website through the google places API? For example, if I find a Barnes and Noble, is there a way for Google Places to return barnesandnoble.com in part of the xml/json response?
According to the current Places API documentation, the URL of the location is not one of the returnable values, so it cannot be retrieved using the API.
The url field returned is the URL of the Google Places page for the location, not the web site of the location itself.

How to get dynamically latitude and longitude on google maps?

I have country and address. How can I retrieve latitude and longitude from Google Maps V3?
I will use this to load the map.
EDIT
This is my actual code, but seems that Google API return this error : W[B].bindTo=function(a,b,c,d){var c=c|...R[p](this,wf,a);this.Pb&&this.Pb(a)};
SOLUTION
remove center: location,
You can retreive this with Geocoding Requests.
You can see my last project that I used this here. See function AddMarker in gmaps3.js for a working real world example. Basically I fetch addresses from database (using AJAX) and then convert them to lat/lon to make markers on the map.
You can use their ReST-API.
http://maps.google.com/maps/api/geocode/json?address=Berlin+Germany&sensor=false
The documentation is in The Google Geocoding API. You will have to do a http request e.g. $.get in jQuery to perform the query and then parse the JSON. Other output formats include XML. There's a JavaScript geocoder on their site as well.
You need to access geocoding.
http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding
http://code.google.com/apis/maps/documentation/geocoding/index.html