Skip to content

Instantly share code, notes, and snippets.

@szechno
Last active November 27, 2025 16:37
Show Gist options
  • Select an option

  • Save szechno/f50fd008512a6e5b7a388635b1a72c20 to your computer and use it in GitHub Desktop.

Select an option

Save szechno/f50fd008512a6e5b7a388635b1a72c20 to your computer and use it in GitHub Desktop.
library(sf)
library(dplyr)
library(mapgl)
library(units)
d <- read_sf("./data/STRLIGHT/STRLIGHT.shp")
maplibre(style = carto_style("dark-matter-no-labels")) |>
fit_bounds(d) |>
add_circle_layer(id = "Streetlighting2",
source = d,
circle_color = "#6bb857",
circle_opacity = 0.8,
circle_radius = 2,
) |>
add_circle_layer(id = "Streetlighting1",
source = d,
circle_color = "#ffffff",
circle_opacity = 0.8,
circle_radius = 1,
) |>
add_control(
html = paste0(
"<div style='font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif; ",
"background: rgba(255,255,255,0.95); padding: 16px 20px; border-radius: 8px; ",
"box-shadow: 0 2px 12px rgba(0,0,0,0.1); max-width: 430px;'>",
"<div style='font-size: 18px; font-weight: 700; color: #084081; line-height: 1.2;'>",
"Streetlighting in West Sussex</div>",
"<div style='font-size: 12px; color: #666; font-weight: 500;'>",
"Firefly map of West Sussex in England, showing areas of light pollution",
"<br />πš–πšŠπšŒπš”πšŠβ€€πšœπš£πšŽπšŒπš‘πš—πš˜<br />28 November 2025",
"</div>"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment