GPS with customized routes

You use the navigation component?

You mean the estimated time to pass this route.

You mean the max speed you can drive in this route?

kodular have some component for this or need to import some extension or api to
follow the polyline

yes a way to calculate this

my question is google maps can interpret this polyline as a navigation system, what is needed? there is something in the kodular for that

image

I think now i understood you.You need to create an api key here:
https://openrouteservice.org/ then use the navigation component to get the directions between two points.The first point and the last point.You will get the distance and time as well.

You mean, use the API, right? This image I posted is of this API. Did the new version of Kodular create this component or not?

1 Like

Sorry :sweat_smile: i meant create an api key.I will go and edit my first post.

1 Like

GPS in your app ?

1 Like

I drew a path in geojson.io I copied all the text but when I run an error.


this error
image

what can be wrong?

Shouldn’t you just take the latitude and longitude pairs of numbers?

That error happens when using get points from json or adding polyline.
P.S: the meaning of the error, that you’ve entered a string , in a place it should be a number.

I am also looking for this. Stil i nit solve this.

Each time you will search here. Their have any api for this.

I tried to put

[[-48.329758644104004,-21.39739875595992],[-48.34134578704834,-21.39693924638317]]

this information without space between the numbers, just to give me only a line
but give an error:
" Attempt to invoke virtual method ‘com.google.android.gms.maps.model.Polyline com.google.android.gms.maps.GoogleMap.addPolyline(com.google.android.gms.maps.model.PolylineOptions)’ on a null object reference
Note: You will not see another error reported for 5 seconds."

if I replace “[” with “(”
((-48.329758644104004,-21.39739875595992),(-48.34134578704834,-21.39693924638317))

gave another error :

The operation AddPolyline cannot accept the arguments: , [nothing], [20], [-81913]
Note: You will not see another error reported for 5 seconds.

Make them as a list, Something like:

1 Like

I had a similar problem, but I’m not on the notebook. More or less that.

1 Like

putting it that way
blocks (1)

return me
image

Look at the blocks above again, it should be list of pairs

1 Like

Try my example ?

Your pairs should be like this :
[
{ lat: 37.772, lng: -122.214 },
{ lat: 21.291, lng: -157.821 },
{ lat: -18.142, lng: 178.431 },
{ lat: -27.467, lng: 153.027 },
]
In my case I returned a Json where the lat and long pairs existed and I assembled a string as shown above.
Because the longitudes and latitudes are in a table in my database. In this table I have this latitude and longitude information for each person registered. So on the return Json, I took these pairs and assembled the pairs to show the markers.

2 Likes

I got it ! I just wasn’t putting it in the correct format as you said lat / long

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.