Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Transit API bus stops in route invisible and on the map disabled

I can't get information from clicking the bus stops although the city has them when I enter in Google Maps, but implementing it myself doesn't work. They are disabled. I'm having a similar problem to another post: Enable bus stop icons clickable in Google Maps

Also when I create a route my stops between the origin and destination don't appear, these white dots are invisible, but if I click in the instructions in the panel this window opens with the information needed.

I've tried out putting transit layer and nothing appears in my jQuery Mobile app.

enter image description here

Any ideas to get this work?

like image 240
mram888 Avatar asked Oct 17 '12 07:10

mram888


People also ask

Does Google Maps tell you when to get off the bus?

BY Rajesh Pandey. Google Maps will now automatically notify you when your stop is approaching while on a public transit and you should get ready to get down. This will ensure that you will not end up missing your stop or forget your belongings while in a hurry to get down on your stop.

How does Google Maps know if a bus is late?

According to Google research scientist Alex Fabrikant, the model to predict delays starts by extracting “training data from sequences of bus positions over time, as received from transit agencies' real-time feeds, and aligned them to car traffic speeds on the bus's path during the trip.” Along with live traffic ...

How do I turn off transit layer in Google Maps?

It cannot be disabled, but it can be hidden away, see: Hiding Map Features with Styling.


2 Answers

I've found part of the solution. I couldn't see the white dots in the route because when I was creating the direction display I was suppressing markers to get my custom markers instead of the usual Google Map ones. But also I was suppressing the middle points that I needed!

Instead of this:

    directionsDisplay = new google.maps.DirectionsRenderer({suppressMarkers: true});

I've changed it for this:

    directionsDisplay = new google.maps.DirectionsRenderer();

So now I can see the dots: enter image description here

I still can't get the bus stops information when clicking an icon

like image 67
mram888 Avatar answered Oct 11 '22 02:10

mram888


You can't get the interactive functionality out of the API that the normal map.google.com has. Using the transit layer gives you a visual display of the transit system, but there's an open bug ticket on this issue: https://code.google.com/p/gmaps-api-issues/issues/detail?id=145.

Even in the official Maps api code demo of a transit layer for London, the transit icons are non-interactive, while on map.google.com they are clickable: https://developers.google.com/maps/documentation/javascript/examples/layer-transit.

like image 21
PBoillot Avatar answered Oct 11 '22 03:10

PBoillot