Deleted past markers

Hello to all.
I am creating a template for a tracking application. On a map, we switch on a switch to start a path of an initial marker (beginning) and an end marker (end), then when we switch back to off, the path is erased, the initial marker that indicates the position returns but the end marker that was created is still displayed. I tried the "MapsAssets" method except that it deletes everything while I need a marker that shows (when the switch is off) the position in real time.
image

Does this help ?

https://groups.google.com/g/mitappinventortest/c/TzgV7czL-mY/m/7SCRFCRwAAAJ

what means "I" and "V" just before the two variables Marker ?

Can't remember the exact meaning, but simply to create two different variable names for the markers, so we know which one is being worked on.

You are using both design time (Marker1, Marker2 etc.) and run time (the ones created using the CreateMarker Blok) Markers.

Design time Markers are very easy to use and 'delete' (actually you hide them or make them visible). Design Time Markers cannot be 'deleted.'

Run time Markers can be 'deleted' by traversing a List of the Markers (similar to the process Tim described). What needs to be done is complex.

It is difficult to determine what you are trying to do because your Blocks image is barely readable.

When working with a Trak, it is often preferable to create a path using a LineString similar to what is described in Store map.features in tinydb - #4 by SteveJG . This example may be what you are attempting. Or perhaps this one: https://groups.google.com/g/mitappinventortest/c/ivLItSb1lIU/m/YKGxke66BQAJ

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

I still can not read your Blocks feedain.

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


by your current location using the LocationSensor.

Is that what you want to do?

yes it looks like

@SteveJG can i join my aia file and you see it. Because even when i hide the marker, it doesn't hide.

Are you using Design time Markers? To hide, Marker1.Visible = false.

Sure, post your aia and I will look at your aia and code..

I use the two type of markers, sure there is my project file.
maps.aia (36.0 KB)

Thank you for sharing your code.

Your problem starts when you used

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).

.

This is how I track using an extension. You might find the article useful.

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.

After some detective work, I established that Arrangement_horizontal3 to expose that feature needs to be set to Visible. :cry:

You don't provide a LocationSensor and the necessary code. I won't code that. Sorry.

Add the new location coordinates to the LineString possibly like this:

linestring1

where LineString1.Points is set to makeTrackList

Arrangement_horizontal3 needs to be set to visible for what ?
so instead of this


i do this ?
image
Logically i delete my 'Markerlist" list to replace them by a "makeTrackList" ?
(Label8 and 9 are my label which show the coordinate)

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.

A way to plot a track using a LineString

LineStringTraks2.aia (4.1 KB)

at the moment the Clear Track code is not coded.