Linestring maps function

I need help to create a linestring function but I am not sure how. The idea is that there is two markers on a map and I want the linestring to draw path from one marker to the other whenever i am displaying a route on the map

Welcome Hang

Is this what you hope to do?

Perhaps you would use Navigate component.

Essentially you need a Map component, two Markers, the Navigate component and a LineString. :wink:

linestringroute

Yes, is the coding just like that? Or is there more? I just want to make the linestring always follow the two markers and make a line to show route

And is there a way to code distance calculation by different transportation modes of the route?

From the documentation:

image

How do you code that in the app? For just driving mode

Use this block:

What components should I use so that there is button and when you click it, it says "Calculating distance" and it shows the distance on the interface?

Follow the tutorial provided above.

this one?

This one:

It doesn't really function as well as the one in the tutorial even though I followed everything right.


Screenshot 2024-10-07 220434

Yes but might be much more complicated depending on what you want to do. Did you do the tutorial Tim pointed you to?
I

Does your question mean you just want to show a route between two locations? Or show a route between two locations and use the LocationSensor to track your progress following the route. The second option means you will either plot a Marker at your current location as you follow the route. You also could create a second line string to show how you actually traveled.

Yes I followed the tutorial. I just want to show the route between 2 locations and have a button calculate the distance of travelling the route.

But it still doesn't work!!

Try the demo aia provided in the tutorial.
Also see this:

done this already

1 Like

You entered your own API key. OK

Do you have a WIFI or data internet connection. The use of the Map requires internet access.

Are you using the tutorial aia exactly as it is or have you modified the code?
The Block image you posted is not legible. If you modified the code that might be your issue. Post your modified aia and someone might be able to help.

What does not work? Do you get an error message? If you don't get an error message, what is not working.

What origin and destination coordinates are you inputting.

Yes I do have a stable Wifi connection. I used all of your tutorial blocks and added other things. The thing is the linestring is not really functioning and I am not sure how to code a distance calculation button.