Map start and current location

How do I use two location markers such that, one points to the starting location which will remain fixed and initialized only when a button is pressed. But the second marker displays the current location and will change as I move from one place to another?

Use a snippet similar to this ProcedurestartLocation to set the start location (assuming you are using the Map component) . First, create the code below, then add a runtime Marker to your Map. Call the Procedure in a Button.

Use the code here How to put my location on a map to create the 'second' , moving marker showing your current location as you move around. The LocationChanged event replots your location as you move around.

To get this to work the way you want it to, you may have to experiment.

Did it work for you?


1 Like

For the START location , you could use a tinyDb to Store the location when you click a Btn, so that it is available iin case u desire to retreive it later (say you close the app after you have moved away and re open the app).
For Current location (Which changes as you move around), you need to use the Lat Long of Loc Sensor When Location Changed event

1 Like

See this.
I have done a sample code for you

I have tried it. It works.
I hope it works out for you as per your requirement as well

1 Like

Did it work out for you??