Show the code
knitr::read_chunk('Mapcode.r')[1] "C:/Users/danny/Documents/git/SiteMaps/ChibanianEA.csv"
custom_div <- tags$div(
HTML("<h3>Custom Styled Div</h3><p>This is an absolutely positioned HTML element overlaying the map.</p>"),
style = "position: absolute;
top: 20px;
right: 20px;
z-index: 1000; /* Ensures the div is above map tiles but below some controls */
background-color: rgba(255, 255, 255, 0.8);
padding: 15px;
border-radius: 5px;
width: 200px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);"
)
symbols <- makeSymbolsSize(
values = 5,
shape = 'diamond',
color = 'black',
fillColor = 'black',
opacity = 15,
baseSize = 10
)f <- leaflet(data = coords6) %>%
addTiles() %>%
addProviderTiles(providers$Esri.WorldPhysical) %>%
# 1. Static Diamonds
addMarkers(
~Lng, ~Lat,
popup = paste("Site:", coords6$Site, "<br>", "Age:", coords6$Proposed.Absolute.Age),
icon = symbols
) %>%
# 2. Draggable Ghost Labels
addMarkers(
~Lng, ~Lat,
# This makes the blue pin invisible but keeps the 'drag handle' active
options = markerOptions(draggable = TRUE, opacity = 0),
label = ~Number,
labelOptions = labelOptions(
noHide = TRUE,
textOnly = TRUE,
direction = 'center', # Better for clicking directly on the number
style = list(
"color" = "black",
"font-family" = "serif",
"font-size" = "11px",
"font-weight" = "bold")
)
)
f