How can I remove attribution in leaflet map in R
Asked Answered
S

2

7

I am working on a shiny application in R which involves maps generated with the leaflet package. I would like to remove the attribution from the map, or at least reduce the visible text.

I tried to modify the attribution value as explained in this topic, setting it to NA,FALSE or '', but none of the options worked for me.

I know there is the option to remove the attribution when working with leaflet in Java, (see here). Do you know if it possible to import this functionality in the R code or if there exists another solution to tackle this?

Shoshonean answered 18/7, 2019 at 10:10 Comment(0)
S
16

I found an answer myself.

It is enough to set the attributionControl option to FALSE in the leafletOptions.

map<- leaflet(
options = leafletOptions(
            attributionControl=FALSE))
Shoshonean answered 18/7, 2019 at 10:32 Comment(0)
Y
0

.setPrefix() method allows modifying Leaflet prefix.

https://leafletjs.com/reference.html#control-attribution-setprefix

attributionControl:false removes attribution completely.

Yuji answered 10/10, 2023 at 11:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.