leaflet.extras icon indicating copy to clipboard operation
leaflet.extras copied to clipboard

How to remove blue circle from the map when search is done?

Open Camil88 opened this issue 2 years ago • 2 comments

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:

obraz

Seems this option doesn't work. How can programatically get rid of this blue circle?

Camil88 avatar Jul 21 '21 20:07 Camil88

Any update please?

Camil88 avatar Sep 09 '21 18:09 Camil88

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)
)

Camil88 avatar Sep 30 '21 12:09 Camil88