I have a question about App inventor GPS (is my location on a line showing my intended path)

I created a GPS app using GOOGLE API in APP INVENTOR. I wonder how to send a notification text when I leave the specified path when I specify the path.


You have to have all the coordinates of the route stored then constantly compare the coordinates of the route with your GPS location to know whether you are on the path.

  • Plot the 'path' on your map using the LineString
  • Simultaneously, plot your present coordinates
  • Watch the map display and VISUALLY see how close your position is to to the LineString plot. Just look at the map and see if your position overlays the path. If it does overlay, you are on the path; if not, you are in a ditch. :thinking: Use an extension to send a notification using a Button because you can not determine overlaying the path or not with any precision at all using code :cry: for many reasons but you might be happy determining how far away you are from the LineString.

It is possible to follow a 'path' and know when you deviate from that path using App Inventor by actually comparing coordinates and calculating distance to the LineString.

How do you expect to do it?

1 Like

Thank you for your help. I'm trying to implement the app using the Line String from now on. Thank you so much.

Actually you should be able to do this :wink:

to calculate how far you are from the line string. Calculate the distance; when it is fewer than 10 m or so, you are approximately on the path otherwise you are not.

The method works but in my opinion, not very well depending on the shape of the path.

1 Like

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