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?
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.
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.
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 . Change the Destination Address from Universal Studios Hollywood to something else.
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? 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.
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.
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
value of the StartMarker and the EndMarker using DoIt debugger. What are they?
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 . Change the Destination Address from Universal Studios Hollywood to something else like Lima Peru. What happens?
. Replace Universal Studios Hollywood with Lima Peru and it should work for you (unless your location is not on an OSM road 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.