rr-leaflet

Popup offset without using markers


Is there a way to offset popups (created independent of markers) in the R version of leaflet?

Experimenting with popup options I've managed to control the offset in X like this:

popup_options <- popupOptions()
popup_options$offset <- x

This works to offset popups created with addPopups by x. I've tried these ideas:

popup_options$offset <- c(x, y)
popup_options$offset <- "L.point(x,y);"

Solution

  • Finally, this works! Somehow it gets recognised as a 'point' type by leaflet.

    popup_options$offset <- list(c(x, y))