# How to remove marker on google maps once another marker is placed

**URL:** https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758
**Category:** Maps
**Created:** [August 15, 2022, 7:05am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758 "2022-08-15T07:05:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [August 15, 2022, 7:05am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/1 "2022-08-15T07:05:44Z")

</div>

Hello, I have so far made an app that will send the user’s location to google maps and display their location with a marker. The Problem I am having is that after a while the maps will be filled with lots of markers so it is hard to see where they are exactly here is an example:

 ![Screen Shot 2022-08-15 at 5.03.21 pm](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/164d4eb751deed5d67be7a2b2dab8f041a65f91e.png)

 ![Screen Shot 2022-08-15 at 5.05.27 pm](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/4/b4b437eacc6990a50691fb746cf61866546bc4b5.png)

As you can see it’s hard to see which marker you are. I would like to know how to make it delete previous markers and also how to make it refresh as well.

Any help would be greatly appreciated.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [August 15, 2022, 7:48am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/2 "2022-08-15T07:48:54Z")

</div>

Does this help?

> **[Map](https://docs.thunkable.com/map#delete-markers-polylines-and-polygons)**

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [August 16, 2022, 6:39am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/3 "2022-08-16T06:39:01Z")

</div>

Thanks, It’s Helpful, I will try to experiment with some of the Info you sent me. I might need your help if I can’t get it to work.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [August 16, 2022, 8:17am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/4 "2022-08-16T08:17:45Z")

</div>

Should I do something like: “After 2 markers are placed, remove the last one”, or something like that?  
If so, how should I do that?

Many Thanks, Levi

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [August 16, 2022, 3:18pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/5 "2022-08-16T15:18:10Z")

</div>

I’m not sure what would be best. It’s not clear exactly what you’re wanting to happen in your app.

But if you do want to do that, it looks like you already have the lat/long pairs in lists so it shouldn’t be hard to just remove the first marker (for example) from the list.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [August 18, 2022, 7:39am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/6 "2022-08-18T07:39:33Z")

</div>

What I mean is how could a make my app delete a marker after a certain time?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [August 18, 2022, 3:04pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/7 "2022-08-18T15:04:56Z")

</div>

Store the current time in a _stored_ variable using the `seconds since 1970` block. Then, when the screen opens, check to see if the current time is greater than the stored time plus some value (for example, 86400 is the number of seconds in 24 hours). If it is, delete a marker.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [August 23, 2022, 10:26am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/8 "2022-08-23T10:26:23Z")

</div>

I will try that

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 10, 2022, 9:43am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/9 "2022-09-10T09:43:24Z")

</div>

I have tried that can you please send me a screenshot of what you did.

Many thanks Levi.

---

<div class="post-metadata">

### Author: ![tanishq](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tanishq/32/124339_2.png) [@tanishq](https://community.thunkable.com/u/tanishq)
#### Post date: [September 10, 2022, 4:09pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/10 "2022-09-10T16:09:12Z")

</div>

This might help you as this works fine for me.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/6/d60e69fa81ed13210f0290c06e9445091cecbe95.png)

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [September 10, 2022, 4:38pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/11 "2022-09-10T16:38:35Z")

</div>

So typically what works best is for you to post a screenshot of what you’ve tried and explain what works or does not work and we can go from there.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 26, 2022, 11:23pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/12 "2022-09-26T23:23:00Z")

</div>

Ok I have tried what you have shown in the scene shot and it does not seem to work, Here is what I have:

 ![Screen Shot 2022-09-27 at 9.21.31 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/3/331fc225db06b13c919673e0415512cfab7d23e7.jpeg)

All I want it to do is remove the previous markers in a way that there is only one marker on the screen at a time, that way the app does not get filled up with markers.

Many thanks Levi

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [September 27, 2022, 11:25pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/13 "2022-09-27T23:25:06Z")

</div>

“It does not seem to work.” Okay, what exactly happens then? Are the markers all deleted? Is one added?

And what is the Button1 Click supposed to do? Why do you have a forever loop with another loop inside it? Why do you need a loop at all?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 27, 2022, 11:59pm UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/14 "2022-09-27T23:59:56Z")

</div>

The button is there so when you click it it will start to send location data to a spreadsheet.

What I have in This screenshot here:

 ![Screen Shot 2022-09-28 at 9.50.12 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/4/f42b7ff76612c643b2928f73a46018bed1366f67.png)

What it does is inconsistently places the markers every 2- 15 seconds then just stops placing markers on the map at all!

Here is a screenshot of the datasheet:

 ![Screen Shot 2022-09-28 at 9.58.50 am](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/b/fb9d095ff2926b25be06459b3ef819ea3a2016d7.png)

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 28, 2022, 12:21am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/15 "2022-09-28T00:21:47Z")

</div>

Do you think I should just change the timer after the loop to make it longer between the times it sends location data?

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 28, 2022, 12:39am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/16 "2022-09-28T00:39:20Z")

</div>

The problem I have is that even if I slow down the number of times it pings the location, it is still hard to see the current location. I was thinking also I could make it so the current marker is a different colour, so it’s easy to identify the current location, if so what would be the best way of doing that?

Many Thanks, Levi

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [September 28, 2022, 1:49am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/17 "2022-09-28T01:49:54Z")

</div>

Are you still deleting markers? Because the latest screenshot does not include the block to do that.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 28, 2022, 1:54am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/18 "2022-09-28T01:54:37Z")

</div>

Yeah, I removed that because it just placed a marker where ever I taped on the screen.

---

<div class="post-metadata">

### Author: ![leviocsmithk](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/leviocsmithk/32/136645_2.png) [@leviocsmithk](https://community.thunkable.com/u/leviocsmithk)
#### Post date: [September 28, 2022, 1:55am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/19 "2022-09-28T01:55:16Z")

</div>

I am not sure what would be easier, to remove the pervious markers, or make the current location marker a different colour.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [September 28, 2022, 2:50am UTC](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758/20 "2022-09-28T02:50:46Z")

</div>

Have you tried different pin colors? You can use a variable in place of the color thumbnail and then assign values using [rgba() strings](https://docs.thunkable.com/color#set-rgba-color) or other methods. That allows you to – for example – assign colors from a list of colors so that each one is different. Or, for starters since it’s quicker, you could just assign a random color and test to see if that works.

[Next page](https://community.thunkable.com/t/how-to-remove-marker-on-google-maps-once-another-marker-is-placed/1999758.md?page=2)
