Deleted past markers

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:

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:


where LineString1.Points is set to makeTrackList

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

i do this ?
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.

no problem, i will wait

@SteveJG After some changes, it works, one problem is that can't delete the last linestring for a new tracking, is there a method for this ?

Yes. One way to 'delete' isshown in this tutorial within the code example How to broadcast a GPS location and share the information on a map with others in real time..CloudDB , sorry, the required code is only in the aia; an image of the Blocks that could be used is not in the actual tutorial documentation.

A similar method is code like this:

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.

Experiment and let us know what works for you. :slight_smile:

1 Like

thanks a lot for this all explanation!