Skip to content

Instantly share code, notes, and snippets.

@han-tun
Forked from walkerke/indoor-mapping.R
Created July 22, 2024 22:43
Show Gist options
  • Save han-tun/bdbe54e9dadb9d14224778c349c70377 to your computer and use it in GitHub Desktop.
Save han-tun/bdbe54e9dadb9d14224778c349c70377 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