Android Question Google Maps TravelMode Walking don't works. (Solved)

Paolo Pini

Member
Licensed User
Longtime User
Hi all ,

I am trying to set the route between 2 coordinates on the map in Walking mode but the route is always presented to me in Driving mode, I have tried various solutions but to no result. I'm definitely getting the call syntax wrong, does anyone know how to correct this string?

Test Url sintax:
    Url="https://maps.googleapis.com/maps/api/directions/json?origin=" & Start1.Latitude & "," & Start1.Longitude & "&destination=" & Arrive1.Latitude & "," & Arrive1.Longitude & "&travelMode=google.maps.DirectionsTravelMode.WALKING, &sensor=false&region=it" & "&key=" & Shared.GoogleMapsAPIKey
    Url="https://maps.googleapis.com/maps/api/directions/json?origin=" & Start1.Latitude & "," & Start1.Longitude & "&destination=" & Arrive1.Latitude & "," & Arrive1.Longitude & "&travelMode=google.maps.DirectionsTravelMode='WALKING', &sensor=false&region=it" & "&key=" & Shared.GoogleMapsAPIKey
    Url="https://maps.googleapis.com/maps/api/directions/json?origin=" & Start1.Latitude & "," & Start1.Longitude & "&destination=" & Arrive1.Latitude & "," & Arrive1.Longitude & "&travelMode.WALKING, &sensor=false&region=it" & "&key=" & Shared.GoogleMapsAPIKey
    Url="https://maps.googleapis.com/maps/api/directions/json?origin=" & Start1.Latitude & "," & Start1.Longitude & "&destination=" & Arrive1.Latitude & "," & Arrive1.Longitude & "&travel_mode=2, &sensor=false&region=it" & "&key=" & Shared.GoogleMapsAPIKey

Many thanks in advance.

Paolo.
 
Last edited:

Paolo Pini

Member
Licensed User
Longtime User
The right syntax is:

B4X:
Url="https://www.google.com/maps/dir/?api=1&origin=" &  Start1.Latitude & "," & Start1.Longitude & "&destination=" & Arrive1.Latitude & "," & Arrive1.Longitude & "&travelmode=walking"

'driving'
'bicycling'
'transit'
 
Upvote 0
Top