LP_WEA

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
coordsX <- read.csv(print("C:/Users/danny/Documents/git/SiteMaps/LatePleisWEA.csv"))
[1] "C:/Users/danny/Documents/git/SiteMaps/LatePleisWEA.csv"
Show the code
coords8 <- coordsX %>%select(-Country, -Ref., -Notes)

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 = coords8) %>%
  addTiles() %>%
  addProviderTiles(providers$Esri.WorldPhysical) %>%
  # 1. Static Diamonds
  addMarkers(
    ~Lng, ~Lat, 
    popup = paste("Site:", coords8$Site, "<br>", "Age:", coords8$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
Show the code
htmltools::save_html(f, file = "C:/Users/danny/Documents/git/SiteMaps/Output/LP_WEA.html")
Show the code
colnames(coords8) <- c("Number", "Site", "Proposed Absolute Age (Ma)", "Dating Method", "Paleontology", "Archaeology", "Hominin Fossils", "Lat", "Long", "Ref")

knitr::kable(coords8, align = "c")
Number Site Proposed Absolute Age (Ma) Dating Method Paleontology Archaeology Hominin Fossils Lat Long Ref
1 Riparo Tagliente 71-57 Biostratigraphy Microtus arvalis, Microtus gregalis, Microtus oeconomus, Ochotona sp., Capra ibex, Cervus elaphus, Capreolus capreolus, Sus scrofa, Alces alces, Marmota marmota, Canis lupus, Ursus arctos Mousterian->Aurignacian H. neanderthalensis 45.54000 11.010000 NA
2 Mezmaiskaya Cave H. neanderthalensis 44.16670 40.000000 NA
3 Tabun Cave 32.67050 34.965500 NA
4 Okladnikov Cave 51.73290 84.033400 NA
5 Kostenki 54.23000 39.300000 NA
6 Sungir 56.18330 40.500000 NA
7 Baigara 58.20000 68.200000 NA
8 Skhul 32.67070 34.966100 NA
9 Lakonis Cave 36.78420 22.577800 NA
10 Vindija 46.30156 16.079687 NA
11 Velika Pecina 44.05310 15.545800 NA
12 Les Rochers 46.41500 0.740800 NA
13 Feldhofer 51.22750 6.945600 NA
14 El Sidron ~38 14C H. neanderthalensis 43.38360 -5.328900 NA
15 Spy 50.48220 4.669200 NA
16 Kent’s Cavern 50.46730 -3.502500 NA
17 Oase 45.08330 21.833300 NA
18 Mladec 49.70650 17.015800 NA
19 Cioclovina 45.35000 23.840000 NA
20 Paviland 51.55000 -4.256000 NA
21 Caverna Generosa 45.93428 9.024694 NA
22 Monte Avena 46.03500 11.758000 NA
23 Gorham’s Cave 36.12030 -5.341900 NA
24 Zafarraya 36.95110 -4.127200 NA
25 Figueira Brava 38.47310 -8.995000 NA
26 St. Cesaire 45.75330 -0.518300 NA
27 Arcy-sur-Cure 47.59150 3.766500 NA
28 Le Moustier 44.99390 1.060000 NA
29 Subalyuk 47.96110 20.530500 NA
30 Guattari 41.23660 13.096700 NA
31 Amud 32.87220 35.501700 NA
32 Shanidar 36.83159 44.221083 NA