HOW TO: Use the Navigate control

Hi All!

I made the navigation map using navigation and other supporting components using https://openrouteservice.org/. All is fine but the directions are coming in one shot.
How to get directions as suitable places or location on the path instead of getting all the directions in one shot?
The directions need to be mapped to the location and the direction in which we are moving.
Can anybody help or give a cue?

Welcome back Someshvar.

Sorry, I do not understand. OSR provides the directions from one location to another (and all the directions in between required to get from the first to the final location). Treat each intermediate location as a final location and query the OSR multiple times to show the directions to the 1st suitable place and then the next suitable place might work for you.

Alternatively, query the Navigate ResponseContent The raw response from the server. This data dump can awkwardly be used to access more details beyond what the GotDirections event provides. You get a json like summary of all the information ORS provides.

A third way, if you are experienced with JSON and willing to get a Google Map API, use the Google Directions API

OSR in my opinion is not very accurate in many instances and the ways to extract detailed information from OSR's raw data are awkward . The Google Directions api, returns coordinates of the start of each 'direction' whereas with OSR, the developer has to derive them and sort through the clutter of extraneous direction posts. :cry:

For a professional app, use the more useful and reliable directions provided by Google instead of OSR. If you are experienced with JSON and willing to get a Google Map API, use the Google Directions API .

Choose OSR or the Google Directions API depending on what your app is for. OSR is free (and you get what you pay for). The Google API provides a certain amount of 'free' usage.

Vertical arrangment 2 içerisine ne eklediniz ?

1 Like

Hallo,
trying to do something like this. I downloaded and uploaded the aia and tested it. But I get an error.
Error 4003: Routing service failed with status 400 Bad Request.
What does it mean? I got API key from https://openrouteservice.org/ . I entered it in Navigation1 , ApiKey

The aia works fine for me. Did you modify the aia other than add the ApiKey?

Are you using the latest Companion 2.66?

You might get Error 4003: Routing service failed with status 400 Bad Request if you don't live in North America and select "use current Location" and click Find Route. I expect ORS possibly cannot provide a route to Hollywood because there is an intervening ocean and no roads :cry: . Change the Destination Address from Universal Studios Hollywood to something else.

Hallo,

thank you very much. I changed the destination and it worked. Good. It means the API key works.
Bad. It means there is a mistake in my code. I got a csv. It needs to read the file, show destinations from the file, the user selects a destination from the file and it shows the way. I will have another look at Read file based on location maybe it helps.
Sorry, another question. I noted in your aias you have Android 5+, Anroid 3..., iOS... How do you get it? If I get iOS can an iPhone connect to the AI Companion or Emulator? Sorry 2 questions.

what is in vertical arrangement 2?

Welcome @Tristan_Holifield

What? The Map component was placed within the VA and all this stuff (look at the aia) . Actually, these components can be placed anywhere you want in your app.

Is that what you wanted to know?

me parece que algo esta mal en este bloque por que no me ubica el lugar de partida aplicandole el check con el GPS por mas que este activado

image

o es necesario obtener mi propio API

por lo demás todo esta bien el único problema es el gps

saludos

yes, the api key is free (see the tutorial).

You must fill in TextBox1 with destination you want using the app.

If the default destination is not on the same continent as your device you will notice error messages.

The Blocks image you posted is blurry. Sorry I can not read it so I do not understand what you are talking about.

What is the problem with the gps? I don't understand your problem. Could you explain in more detail? The gps takes up to a minute to determine where your device is located; it must get a satellite fix.

The actual use of Navigate is easy, the tutorial shows several options that make it appear complicated. :slight_smile:

puse check use currente Location
en el TextBox1 Universal Studios Hollywood

WhatsApp Video 2023-03-15 at 7.11.07 PM

espere el minuto y no salió nada

cambie la dirección de llegada en un lugar mas cercano y sale lo mismo por cierto estoy en el mismo continente

The error message indicates ORS cannot generate a route between your GPS location and the other location. Why I cannot tell; it is possibly because your GPS is not getting a location fix. What

[quote="SteveJG, post:10, topic:5900, full:true"]

The aia works fine for me.

Are you using the latest Companion 2.66?

You say you are in North America. Check the
doitNavigate
value of the StartMarker and the EndMarker using DoIt debugger. What are they?

si estoy utilizando la última Companion 2.66

no modifique nada estoy trabajando con este .aia que enviaste
DirectricesNavegaciónSimple.aia (250.0 KB)

estoy en américa del sur Perú

@elmachi130 The app works as intended without error messages.

You get Error 4003: Routing service failed with status 400 Bad Request since you don't live in North America and select "use current Location" and click Find Route. I expect ORS possibly cannot provide a route to Hollywood because it cannot navigate the Panama Canal and no roads :cry: . Change the Destination Address from Universal Studios Hollywood to something else like Lima Peru. What happens?
navigateLocation . Replace Universal Studios Hollywood with Lima Peru and it should work for you (unless your location is not on an OSM road :cry: and cannot 'connect'.

Although Navigate provides a 'route' the free service is not very smart and does not optimize the route. It works best for short distances. In my opinion, ORS is a toy.

WhatsApp Video 2023-03-16 at 8.57.41 AM
espere hasta 3 minutos y nada la dirección
av el parral comas
si es ubicable cuando busco de un punto a otro punto

el problema es cuando uso
use current Location

y mi ubicación también es ubicable ya que vivo en una zona urbana y nunca e tenido problemas con mi ubicación por GPS

en tu imagen veo 3 Marker rojo verde y amarillo
image

a mi me sale solo rojo y verde Marker1 esta deshabilitado en el .aia

image

será por eso?

av el parral comas Lima Peru perhaps????????? insufficient address

Hi

Anyone has the below error messages?

Error 4003: Routing services failed with status 404 Not Found.

I downloaded your .aia and got this error and my project has same errors.

Please comment me.
Thanks

See here ?

1 Like

Oh good news.
If it is companion bug, do you think if the app build, then no problem happened??

Thanks for you response.

If you use the modified companion app and it works, why not try a compiled app and see if it works ?

1 Like