Google Maps Turn-By-Turn instructions

warwound

Expert
Licensed User
Longtime User
You'll only be able to use the javascript Directions Service (the one you linked to) inside a WebView.

Take a look at this recent post of mine: http://www.b4x.com/android/forum/threads/start-navigation-with-a-button.17459/#post-182497
There i have managed to use a javascript web service within a WebView - the WebView functions as required even though it has not been added to the Activity layout.

Google do also provide an HTTP web service Google Directions API and you can use say HttpUtils2 to use this service - it's not a javascript based API and therefore requires no WebView.

Martin.
 
Upvote 0

urikupfer

Member
Licensed User
Longtime User
Hi

I have made a little application , which combines google maps v2 and javascript for using google maps v3 (the googlemaps.html file in files folder),

The application is just for learning , then it contains some garbage , and some of the menu are in Hebrew (just choose the third option)

For the menu drag the left side to the right.

Hope it will help you.

Uri
 

Attachments

  • googlemaps.zip
    47.1 KB · Views: 300
Upvote 0

yckhor

Member
Licensed User
Longtime User
Thanks guy (warwound & urikupfer).
Can't wait to experiment. Keep it coming if you have new ideas :)
 
Upvote 0

yckhor

Member
Licensed User
Longtime User
Hi

I have made a little application , which combines google maps v2 and javascript for using google maps v3 (the googlemaps.html file in files folder),

The application is just for learning , then it contains some garbage , and some of the menu are in Hebrew (just choose the third option)

For the menu drag the left side to the right.

Hope it will help you.

Uri
Hi urilupfer,
ran into some compilation error. can't find the library for declared type of html and variable projections1

Dim Html1 As Html 'what lib should I be included
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
Hi,

you can make a copy of the urigooglemaps.b4a and open it with an editor; here you find the following:

NumberOfLibraries=11
Library1=ahaactionbar
Library2=core
Library3=dialogs
Library4=geocoder
Library5=googlemaps
Library6=googlemapsextras
Library7=labelextras
Library8=phone
Library9=reflection
Library10=stringutils
Library11=webviewextras

The HTML problem result from missing the labelextras library.

Reinhard
 
Last edited:
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
Hi

i have tried your sample and want to use the waypoint optimization; in line 239 of the html code the is: optimizeWaypoints: true. I used a sample with ten own waypoints and the order of the waypoints was not changed.
Have you found out more about this optimization possibilities?

Reinhard
 
Upvote 0

urikupfer

Member
Licensed User
Longtime User
Hi

I say it also ,The google api doesn't change the order of the way points, for this, I think , you will have to use the google's "Distance Matrix service" or something like that ,
And with the "Travelling salesman problem" (see http://en.wikipedia.org/wiki/Travelling_salesman_problem) algorithm ,calculate the optimum way points arrangement. and then feed the way points new order to calculate the route.

uri
 
Upvote 0
Top