Skip to content

Instantly share code, notes, and snippets.

@walkerke
Created July 19, 2024 19:16
Show Gist options
  • Save walkerke/69eff79275f748cd3f52ebd18dc60c58 to your computer and use it in GitHub Desktop.
Save walkerke/69eff79275f748cd3f52ebd18dc60c58 to your computer and use it in GitHub Desktop.
library(mapgl)
mapboxgl(
style = mapbox_style("streets"),
center = c(-87.61694, 41.86625),
zoom = 15.99,
pitch = 40,
bearing = 20,
antialias = TRUE
) |>
add_source(
id = "floorplan",
data = "https://docs.mapbox.com/mapbox-gl-js/assets/indoor-3d-map.geojson"
) |>
add_fill_extrusion_layer(
id = "room-extrusion",
source = "floorplan",
fill_extrusion_color = get_column("color"),
fill_extrusion_height = get_column("height"),
fill_extrusion_base = get_column("base_height"),
fill_extrusion_opacity = 0.5
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment