I place a first marker for the first point, after that each 2 seconds a marker is created to do linestring, for finish a last marker is placed. Also after that, when it finished i only want to display the first marker
Some comments that might help you finish your app:
Two seconds is updating too frequently. Generally, the LocationSensor cannot elicit a satellite fix and LocationChange that frequently.
To simplify your code, I recommend you do NOT use the CreateMarker Block. You only need the start and end Markers. Use the Marker1 and Marker2 Blocks instead.
Yes, you can do that. Code Marker2.Visible = false when you 'finish.' That should leave only the Marker1 visible on your Screen. You will possibly also will want to clear the coordinates from the LineScreen and/or hide the LineScreen you created.
I try to be the more clearly as possible. I will follow your advice, that use only marker block but before the end(also when the tracking is finished) Linestring must be displayed. End when it finished, linestring disapeared but the last marker is displayed. If you want i can join the .aia
OK, you hope to display something like this. The start location (green), the LineString track, the current location (red) can be displayed several ways. The red marker always displays as the penultimate final location. The final location can either be the last coordinates in your LineString or a location determined
the CreateMarker (a Run time Marker). It is difficult to 'delete' or hide specific Run time markers. You are apparently creating a Marker every time the location changes. I recommend you do not do that. Rely on your StringGrid points and only use TWO DesignTime Markers. I constantly reuse Marker2 by updating its coordinates.
I don't have your BlueTooth connection, I cannot test your Project or understand how your app is supposed to work. I recommend not to use Run time Markers in your app. Instead of making a list of intermediate Run time Markers, make a list of intermediate locations (latitude,longitude) if you need that information or extract it from the Point List.
How I handle the issue of Hiding the origin Marker (I use Marker1) and hide the LineString track and displayi only the destination Marker (assuming the destination is Marker2).
I understand my mistake better, but how could I trace the lineString every time the location is updated if I use marker1 for example. And so I don't use lists either?
I would like you to help me in this case to replace the block that creates the markers please
For the test, you can do it with the location sensor of your phone, every 30 seconds (for example) the location is updated, and when the switch is set to "professionel" we trace the path until the "fin" button if clicked.
To expose the professional setting. You have the arrangement set to invisible
by default.
Essentially, I think that is correct. I will code some Blocks to show how to update a LineString for new points later today if I have time. It is relatively simple.
Thank you very much, that's very kind of you.
I think i need to deleted "Markerlist" and replace with an other list but i am blocked here...
I will wait for your proposal.
LineStrings cannot be deleted with code or values nulled out because a LineString requires there always be two locations associated with it . A developer cannot simply set LineString1.Points to an empty string. The values in the existing LineString consequently need to be replaced. Either of these code examples use code that replace the LineString with the current coordinates of the LocationSensor. That effectively 'deletes' your previous track display and the coordinates in a List of coordinates of the tracks collected so far and lets you start tracking fresh. The code disables the LocationSensor and requires you reenable it when you start a subsequent track.
The second example assumes Marker1 is the origin and Marker2 is the destination.