Skip to content

Instantly share code, notes, and snippets.

@walkerke
Last active July 1, 2024 15:14
Show Gist options
  • Save walkerke/844e9ecb9a6cf0d1f4f4fe70c4b1dc41 to your computer and use it in GitHub Desktop.
Save walkerke/844e9ecb9a6cf0d1f4f4fe70c4b1dc41 to your computer and use it in GitHub Desktop.
library(tigris)
# remotes::install_github("walkerke/mapgl")
library(mapgl)
options(tigris_use_cache = TRUE)
tarrant = tracts("TX", "Tarrant", cb = TRUE)
mapboxgl(style = mapbox_style("light")) |>
add_fill_extrusion_layer(
id = "tracts",
source = tarrant,
fill_extrusion_color = "blue",
fill_extrusion_opacity = 0.6,
fill_extrusion_height = 50,
popup = "GEOID",
hover_options = list(
fill_extrusion_color = "red",
fill_extrusion_height = 5000
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment