Calabrian: East Asia (EA)

Show the code
knitr::read_chunk('Mapcode.r')
Show the code
library(leaflet)
require(leaflet.providers)
library(dplyr)
require(knitr)
require(gapminder)
library(htmltools)
require(magrittr)
require(tidyr)
library(leaflegend)
require(skimr)
require(knitr)
require(RefManageR)
require(devtools)
require(flextable)
require(ftExtra)
require(officer)
Show the code
coords5 <- read.csv(print("C:/Users/danny/Documents/git/SiteMaps/CalabrianEA.csv"))
[1] "C:/Users/danny/Documents/git/SiteMaps/CalabrianEA.csv"
Show the code
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
)
Show the code
f <- leaflet(data = coords5) %>%
  addTiles() %>%
  addProviderTiles(providers$Esri.WorldPhysical) %>%
  # 1. Static Diamonds
  addMarkers(
    ~Lng, ~Lat, 
    popup = paste("Site:", coords5$Site, "<br>", "Age:", coords5$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 = 'left', # Better for clicking directly on the number
      style = list(
        "color" = "black",
        "font-family" = "serif",
        "font-size" = "11px",
        "font-weight" = "bold")
    )
  )

f