Google Intent Modes google.navigation?

I am currently developing an application that will launch navigation. I know this is not an official API, but it works just the way I want.

I allow the user to choose navigation, walking and bus navigation to the place. The goal of launching directly in Google Maps Navigation is as follows:

google.navigation:ll= + latitude and longitude, then + &mode= , and then your mode of transport. For example, to navigate walking routes to a specific area:

google.navigation:ll=blah,blah&mode=w

The default driving is &mode=d , and the bike is &mode=b , but I cannot determine the bus (public transport).

Has anyone done this before?

Thanks!

Edit: So far I have found that mode=public gives routes for the bike, mode=transit gives driving, which is disappointing, mode=bus also returns the directions of the bike.

More: mode=train also gives driving ... There GOT is a way to do it ...

Other Editing: I realized that now I’m sure it isn’t there, because after experimenting with terms, I realized that instead I have to run the Google Maps intent with a bus search, but does anyone know how to do this?

+7
source share
2 answers

After a lot of guessing and hunting, I decided that it was impossible to switch to tire navigation right away, because it would include SELECTING a bus for a person to drive, which does not make sense.

Instead, you can run them to search on Google Maps at their destination, for example, thanks to this answer to answer a similar question:

"http://maps.google.com/maps?daddr=lat,long&dirflg=r"

C &dirflag indicating public transport. (Why "g" I have no idea ...)

+4
source

You should be able to add a travel mode , if necessary, with the travel modes listed below.

  • Driving (default) indicates standard driving directions using the road network.
  • walks on footpaths and sidewalks (where available).
  • A bike requests cycling routes along bike paths and preferred streets (where available).
  • requests for transit requests via public transport routes (if any).

If you want to run Intent and allow the user to choose between Maps or Browser, you can do it this way.

 Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?saddr="+ starting_point_lat+","+starting_point_long+"&daddr="+dest_point_lat+","+dest_point_long+"&mode=transit")); startActivity(intent); 
+1
source

All Articles