My Application shows an error when call for Direction request

Help me ..............

Code in the screen 1
blocks
Code in the screen 2

error shown in the app

Welcome Hirusha.

Is that all your Navigate code?

This tutorial demonstrates how to use the Navigation control.

HOW TO: Use the Navigate control

Did you follow the advice there? Does the example work but your app does not? Did you obtain an ORS api key?

If you did do the tutorial you need to be aware that the service occasionally cannot provide a route if one of the coordinates is not near a road.

yes I did make an api key from openrouteservice.org and I did the code correctly but, I wasn't aware that service can't provide route to that location if one of them is not near the road, is that the problem?

The problem could be that 'one of them is not near the road' but it is also likely another issue.

Where do you set values to the Start and End coordinates?

You should have these blocks.navigationStartEnd with latitude/longitude values (where I show 0's).

Your RequestDirections requires you have information in these Blocks or in the Navigation.EndLocation etc. if you use an address. I don't see these Blocks in your code. :cry:

can you give us the aia file so we can correct it.

do you need this code asap?

I give my end location in screen one to tinydb1 then in screen two I take it back from tinydb1 ,that's why you cant see those blocks on the screen....

here is the aia but I have to say my project is kinda big and un organized....
its for an local hackathon i must upload it to them before 17th

1 Like

you are in slasscom?
techkids

i found the problem,

you have not entered the location of the place to map instead you have entered a string.

create two global variable to get lattitide and longitude and then set the end.latitude to latitude variable and same for longitude you must find out the coordinates of each location and apply both to the variables

thank you,
best regards

yes
techkids

i did it, is it correct
still it shows that same error

change the end lat and long to tinydb lat and long

and when you are storing lat and long to tiny db remember to store the appropriate lat and long to both tiny db for each place to travel
you have stored a text in tiny db not the corect lat and long

the variables should be the end lat and long so whenever someone clicks on sigiriya or whatever the button should set both variables to sigiriya's lat and long and then set the end lat and long of the navigation to the variables similarly all buttons of places needs to set the variables to there appropriate lat and long

you can google the lat and long of the place in google and set the variable to that lat and long so that the navigation destination is on that place

i did that too but error still occurs

then do you know a way to save lat and long as a value (not as a text)
not like this

remove the text and put in that place as join ,split join to three texts, put number blocks on the first and third, and on the middle put a text with a comma

is tiny db 1 latitude?

yes.............. it is

are the coordinates correct