SymbolixAU / mapdeck

R interface to Deck.gl and Mapbox

Home Page:https://symbolixau.github.io/mapdeck/articles/mapdeck.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No elevation on GeoJson layers

bdbmax opened this issue · comments

Describe the bug
It seems GeoJson Layers don't render elevation on polygons.

To Reproduce
The sample code in the add_geojson documentation shows the bug:

## putting elevation and width values onto raw GeoJSON
library(geojsonsf)
sf <- geojsonsf::geojson_sf( geojson )
sf$width <- sample(1:100, size = nrow(sf), replace = TRUE)
sf$elevation <- sample(100:1000, size = nrow(sf), replace = TRUE)
geo <- geojsonsf::sf_geojson( sf )

mapdeck(
, location = c(145, -37.9)
, zoom = 8
, style = mapdeck_style("dark")
, pitch = 35
) %>%
add_geojson(
  data = geo
)

Screenshots
image

Versions
0.3.4

commented

You need to set extruded = TRUE to show elevated polygons. I've updated the example in ?add_geojson to include this.

mapdeck(
  , location = c(145, -37.9)
  , zoom = 8
  , style = mapdeck_style("dark")
  , pitch = 35
) %>%
  add_geojson(
    data = geo
    , extruded = TRUE
  )

Screenshot 2022-01-18 at 8 32 41 am

Great, this fixes it. Thank you!