You can add an attribution
argument to addTiles
:
leaflet(data = quakes[1:20,]) %>%
addTiles(attribution = 'I did this, you hear?! Also Leaflet.') %>%
addMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag))
I'd love to know how to do this with addProviderTiles
, though, because that doesn't appear to accept an attribution
argument :/
EDIT: okay, my workaround for using provider tiles has been to just use both functions. I hope it's not actually calling both tiles, since that's a bit of a waste of user bandwidth—but hey, it looks fine!
leaflet(data = quakes[1:20,]) %>%
addTiles(attribution = 'I did this, you hear?! Also Leaflet.') %>%
addProviderTiles(providers$OpenStreetMap.Mapnik) %>%
addMarkers(~long, ~lat, popup = ~as.character(mag), label = ~as.character(mag))