After I remove a marker from Google Map, using marker.remove(), I want to add the same marker again. Like, I want to Hide and Show the marker.
I don't want to create MarkerOptions every time. Is there a simple way? though there should have been an intuitive way to do this simple thing.
The answer I found is:
If you just want to hide and show, the use this
marker.isVisible = true/false Or marker.setVisibility(true/false) //for java
There is no direct way to add a Removed marker again, unless u keep reference to MarkerOptions. You can save its reference like marker.tag = markerOptions
. Although, in the function description of remove()
it says it doesnt guarantee any operation on marker after remove()
is called. But i think TAG wont go anywhere.