I see most of the logic Mike, unfortunately I was not able to determine with certainty where you construct the LineString. You have been busy.
2) I believe you see the errors because you calculate your LineString on the fly using complex formula . That calculation probably cannot keep up with rapid Map changes using either the Map's + / - buttons or by expanding or pinching the Map itself with touches. You elicit the Runtime error regarding XML (the LineString is stored internally as an XML file.
How can you fix this?
1)Save the LineString calculation to a global variable periodically. Use the pre-calculated LineString instead of a continuously changing LineString, I expect you would not get the error Mike. I guess it is important to continuously update?
2) A factor might be how often you update both your location AND the LineString. How often do you attempt a satellite fix (e.g. what is the LocationSensor..TimeInterval)?. You may be checking too frequently.and that exacerbates the problem if the LocationSensor.ChangedLocation event triggers calculation of the LineString coordinates.
3) You appear to calculate a lot of things using your own Blocks. Still, you use the MIT Map component that has similar routines built-in that execute faster. Using the built-in routines would make your determination of the LineString coordinates faster; that might help.
4) Niclas Rins AdvancedLocationSensor is a great tool; in this case the standard LocationSensor might be more appropriate as a guess. You place a lot of calculations into the LocationChanged event. Doing this is sometimes OK but if your calculations are extensive, this programming practice can and will cause unexpected issues because App Inventor processes asynchronously.
5) This happens when "when both "EnableZoom" and "ShowZoom" are logical "True" ... so do not have them set that way all the time or try this using only EnableZoom (so you use pinches and expansion to control the screen map tiles). A magic cure might be to add a when Map1.BoundsChanged event to inhibit the LineString from changing during a zoom.
6) Another magic cure might be to add an empty Screen1.ErrorOccurred block. This technique might suppress the error message and allow you app to not freeze. This is not the best programming practice, but it might be a practical solution. Sometimes providing a block will hide the error message, then allow the app to continue without stalling. More often it won't help, but you could try it.
7) When the LineString is NOT continually changing (as in my apps) the error you see does not happen. Either a bug in the component or something wrong with how you defined it . You continuously update it and I expect occasionally the map tile size is changed simultaneously with changing the coordinates used to display the LineString and the compiled app gets confused and elicits an error. After looking at your Blocks Mike, I believe this behavior is not really a bug but how you continuously update the course LineString.
8) I doubt this is a component bug. I expect these Properties behave as expected along with the OpenStreetMap api that MIT uses. It is probable MIT cannot change their behavior which, based on my own experience using a static LineScreen working properly while zooming, cannot change the behavior. I expect you have to live with this and adapt your app.
I hope these comments are useful. Interesting app, I used to race a 470. Good luck with it.
Regards,
Steve