I require some help in getting my elevation to show in mapdeck. For some reason I cant seem to get the code to work. I can show the points on the map as 2D points using "add_scatterplot" but whenever I try and get it to use the elevation data it does not appear to work and I keep getting the same error. Here is my code and said error:
mapdeck( token = key, style = mapdeck_style("satellite"), location = c(-2, 57.22),
zoom = 12,
pitch = 35) %>%
add_scatterplot(
data = turbines,
fill_colour = "Turbine_identifier",
palette = "green2red") %>%
add_trips(
data = sf_harriers,
stroke_colour = "TrackId",
animation_speed = 14,
trail_length = 80,
opacity = 1,
stroke_width = 2,
palette = colourvalues::get_palette("heat")[6:13, ]) %>%
add_column (
data = turbines,
lat = "latitude",
lon = "longitude",
elevation = "hub_height",
elevation_scale = 100,
update_view = FALSE)
The error that spits out is:
""Error in if (nrow(df) != nrow(.data)) { : argument is of length zero""
Which I dont understand as if I plot it without the last layer it plots fine. However when i use "add_column" to then try and get those points to display in 3D using their elevation, it keeps ringing that error. What am I doing wrong?