leaflet.extras
leaflet.extras copied to clipboard
How to remove blue circle from the map when search is done?
Hello, I found a similar topic here on 'Issues' but in my opinion the problem is not solved yet. I try to hide blue circle which appears when address in found on a map. I'm using hideMarkerOnCollapse
:
leaflet.extras::addSearchOSM(
options = leaflet.extras::searchOptions(
hideMarkerOnCollapse = TRUE)
)
And still see this on a map:
Seems this option doesn't work. How can programatically get rid of this blue circle?
Any update please?
I've found the answer to my own question. Hiding blue circle is possible and there are 2 ways of doing it. First, you need to use some CSS and catch circle class + one of the key attributes which distinguish blue circle from other map markers' attributes. Then hide it. I chose this one: [stroke="#3388ff"]
. So finally we got this:
path.leaflet-interactive[stroke="#3388ff"] {
display: none;
}
Other option is to use it leflet option. Basically, addSearchOSM(options = searchOptions(hideMarkerOnCollapse = TRUE))
which hides the marker works only with autoCollapse = TRUE
. Then the search marker is not visible on a map at all:
leaflet.extras::addSearchOSM(
options = leaflet.extras::searchOptions(
autoCollapse = TRUE,
hideMarkerOnCollapse = TRUE)
)