SymbolixAU / mapdeck

R interface to Deck.gl and Mapbox
https://symbolixau.github.io/mapdeck/articles/mapdeck.html
362 stars 40 forks source link

No elevation on GeoJson layers #351

Closed bdbmax closed 2 years ago

bdbmax commented 2 years ago

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

dcooley commented 2 years ago

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

bdbmax commented 2 years ago

Great, this fixes it. Thank you!