Show the code
knitr::read_chunk('Mapcode.r')This repository and website serve as a means to share, create, and visualize spatiotemporal information related to hominin sites throughout the Pleistocene. The information below includes both an interactive map and a dynamic table. Tables and maps are able to be exported into a word processor for manuscript development.
I’m using a couple of packages to bring these maps to life. These laregly include leaflet (along with its add-ons) and the htmltools package. These operations have specfic parameters to be established which are detailed below.
[1] "C:/Users/danny/Documents/git/SiteMaps/Coordinates.csv"
colnames(coords) <- c("Site_Number", "Lng", "Lat", "Site Name", "Age", "Period")
# I need to set some parameters for how I want the map to be designed. This first parameter is for the icons used. For more details visit https://roh.engineering/posts/2021/05/map-symbols-and-size-legends-for-leaflet/
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 = 10,
shape = 'diamond',
color = 'black',
fillColor = 'black',
opacity = 1,
baseSize = 10
)
tag.map.title <- tags$style(HTML("
.leaflet-control.map-title {
background: rgba(255,255,255,0.7);
padding: 10px;
font-size: 20px;
font-weight: bold;
text-align: center;
}
"))
title <- tags$div(tag.map.title, HTML("CLP Hominin Sites"))The data presented in this map and table was taken from my earlier work on the topic. I used this material mostly to figure out the map building process. The table I included (which the map is drawn from) is intentionally simplistic. If we are using this page for sharing/visualizing information, we can keep all tables used for this pretty simple. See below, however, for how a more comprehensive table would appear.
m <- leaflet(data = coords)|> addTiles() |>
addControl(title, position = "topleft", className = "map-title") |>
addProviderTiles(providers$Esri.WorldPhysical) |>
addMarkers(~Lng, ~Lat,
popup = paste("Site:", coords$Site, "<br>",
"Age:", coords$Age),
icon = symbols,
label = ~Site_Number,
labelOptions = labelOptions(noHide = TRUE, textOnly = TRUE, direction = 'left',
offset = c(-4, -4),
style = list(
"color" = "black",
"font-family" = "serif",
"font-size" = "16px",
"font-weight" = "bold"),
))
m| Site_Number | Lng | Lat | Site Name | Age | Period |
|---|---|---|---|---|---|
| 1 | 109.9209 | 34.7738 | Dali | 267-258 ka | Chibanian |
| 2 | 117.5151 | 31.3255 | Chaoxian | N/A | Unknown |
| 3 | 113.6054 | 24.6740 | Maba | 135-129 ka | Chibanian |
| 4 | 122.1308 | 40.3700 | Jinniushan | 200-260 ka | Chibanian |
| 5 | 116.5654 | 30.0634 | Hualongdong | 275-331 ka | Chibanian |
| 6 | 113.4040 | 34.0408 | Xuchang | 125-105 ka | Late Pleistocene |
| 7 | 102.3417 | 35.2653 | Xiahe | 160 ka | Chibanian |
| 8 | 126.3827 | 45.4527 | Harbin | 309-138 ka | Chibanian |
| 9 | 113.5900 | 40.0600 | Xujiayao | 220-160 ka | Chibanian |
| 10 | 104.0840 | 25.3738 | Panxian Dadong | 300-190 ka | Chibanian |
| 11 | 105.1640 | 20.3722 | Ma U’Oi | 193-49 ka | Chibanian |
| 12 | 103.2432 | 20.1241 | Tam Ngu Hao | 164-131 ka | Chibanian |
| 13 | 120.2637 | -8.1500 | Liang Bua cave | 100-60 ka | Late Pleistocene |
| 14 | 121.4925 | 17.4211 | Callao Cave | 67-50 ka | Late Pleistocene |
The data for this map and table were taken from the google doc shared with the group. I additionally added the Lat/Long, Number, and Ref. columns for ease of translation.
[1] "C:/Users/danny/Documents/git/SiteMaps/EPleis.csv"
d <- leaflet(data = coords1)|> addTiles() |>
addProviderTiles(providers$Esri.WorldPhysical) |>
addMarkers(~Long, ~Lat,
popup = paste("Site:", coords1$Site, "<br>",
"Age:", coords1$Proposed.Absolute.Age),
icon = symbols,
label = ~Number,
labelOptions = labelOptions(noHide = TRUE, textOnly = TRUE, direction = 'left',
offset = c(-2, -2),
style = list(
"color" = "black",
"font-family" = "serif",
"font-size" = "16px",
"font-weight" = "bold"),
))
dThis is a more comprehensive table than I originally built. As long as all of the information is in an Excel file (.csv), I can include or omit information with ease.
| Number | Site | Proposed Absolute Age | Dating Method | Paleontology | Archaeology | Hominin Fossils | Lat | Long | Ref. |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Xihoudu | ~2.43 Ma | Isochron 26AL/10Be | Stegodon sp., Equus sanmeniensis, Hipparion sinense, Coelodonta antiquitatis shansius, Elaphurus chinnaniensis, Axis shansius | None reported | 34.69300 | 110.2700 | 1,2,3 | |
| 2 | Shangchen | ~2.12-1.26 Ma | Magnetostratigraphy | A cervid, a bovid, a suid | 88 flakes, 20 unmodified stones | None reported | 34.13070 | 109.2908 | 4 |
| 3 | Longgupo | 2.2-1.4 Ma | Paleomagnetic | Sinomastodon, Nestoritherium, Equus yunnanensis, Ailuropoda microta, Mimomys peii | 1000+ stone artifacts | 1 fragmental mandible, 1 incisor (controversial, probably belong to ape) | 30.51468 | 109.3956 | 5,6 |
| 4 | Renzidong | 2.14-2.15 Ma | Biostratigraphy Paleomagnetic | Ailuropoda microta, Homotherium crenatidens, Ursus cf. microdontus, Sinomastodon intermedius, Equus sanmeniensis, Tapirus sanyuanensis, Rhinoceros sinensis, Sus peii, Cervavitus Ultimus, Cervus unicolor | 59 stone artifacts (cores, flakes, scrapers), 10+ bone artifacts (? | None reported | 31.53800 | 118.5770 | 7,8,9,10 |
| 5 | Yuanmou | ~1.78-1.59 Ma | Isochron 26AL/10Be, Paleomagnetic | Equus yunnanensis, Canis yuanmoensis, Hyaena licenti, Axis shansius, Axis cf. rugosus, Rusa stehlimi, Vulpes cf. chikushanensis, Viverricula malaccensis fossils, Rhinoceros sinensis, Ochotonoides complicidens | 30 stone artifacts, 2 potential bone tools | 2 incisors, 1 tibia (H. erectus) | 25.40395 | 101.5442 | 11,12,13 |
| 6 | Yunxian | ~1.75-0.6 Ma | Isochron 26AL/10Be, Magnetostratigraphy, lithnostratigraphy, ESR/U-series | Rhinopithecus lantianensis, Felis peii, Cuon javanicus, Hyena licenti, Ailuropoda melanoleuca wulingshanensis, Stegodon orientalis, Equus sanmeniensis, Sus lyddekeri | 207 stone artifacts | 3 crania | 32.50239 | 110.3573 | 14,15,16 |
| 7 | Mohui cave | 1.69-1.29 Ma | ESR/U-series | Gigantopithecus blacki, Macaca sp., Leopoldamys sp., Niviventer sp., Hapalomys sp., Typhlomys sp., Hystrix subcristata, Hystrix magna, Cuon (Cyon) sp., Nestoritherium sp., Ailuropoda microta, Ursus thibetanus, Mustelidae, Felis teilhardi, Stegodon sp., Sus xiaozhu, Sus peii, Cervidae, and Bovidae | 8 stone artifacts | 1 tooth | 23.34891 | 107.0013 | 17,18 |
| 8 | Lantain/Gongwangling | ~1.63 Ma | Magnetostratigraphy, cosmogenic | Rhinopithecus lantianensis, Megantereon lantianensis, Ailuropoda melanoleuca fovealis, Stegodon orientalis, Equus sanmeniensis, Tapirus sinensis, Dicerorhinus lantianensis, Magaloceros konwanlinensis | 20 stone artifacts including cores, flakes, and scrapers | 1 H. erectus skull, 1 molar | 34.11015 | 109.2924 | 14,19,20 |
| 9 | Jianshi/ | ||||||||
| Longgudong | 1.51-1.04 Ma | ESR/U-series | Ailuropoda cf. melanoleuca fovealis, Hyaena licenti, Equus yunnanensis, Tapirus sinensis | Some stone artifacts (whether they were related to hominins or Gigantopithecus is uncertain) | 3 teeth from excavation, 1 tooth collected | 30.39149 | 110.0429 | 14,21 |