79565421

Date: 2025-04-09 22:31:02
Score: 1
Natty:
Report link

You mean like this?

out

library(leaflet)
library(htmlwidgets)

leaflet() %>%
  addTiles() %>%
  setView(lng = -121.2722, lat = 38.1341, zoom = 10) %>%
  addMiniMap(tiles = providers$OpenStreetMap, position = 'topleft', width = 250, height = 420) %>%
  onRender("
function(el, x) {
  var map = this;
  if (map.minimap && map.minimap._miniMap) {
    var mini = map.minimap._miniMap;

    var style = document.createElement('style');
    style.innerHTML = `
      .transparent-tooltip {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        font-weight: bold;
      }
    `;
    document.head.appendChild(style);

    L.circleMarker([37.79577, -121.58426], { radius: 2 })
      .setStyle({ color: 'green' })
      .bindTooltip('mylabel', {
        permanent: true,
        direction: 'right',
        className: 'transparent-tooltip'
      })
      .addTo(mini);
  }
}
") 
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: Tim G