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:
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.
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.
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.
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.
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?
Have you tried different pin colors? You can use a variable in place of the color thumbnail and then assign values using rgba() strings 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.