Closed samatt closed 1 year ago
Using the example data in ?add_grid()
worked for me.
Can you try this and see what happens for you?
Thanks for the suggestion I just ran the same code and dont get a legend
df <- read.csv(paste0(
'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/',
'examples/3d-heatmap/heatmap-data.csv'
))
df <- df[ !is.na(df$lng ), ]
mapdeck( token = MAPBOX_API_KEY, style = mapdeck_style("dark"), pitch = 45 ) %>%
add_grid(
data = df
, lat = "lat"
, lon = "lng"
, cell_size = 5000
, elevation_scale = 50
, layer_id = "grid_layer"
, auto_highlight = TRUE,
legend = T,
legend_options = list(tite = "Test Legend")
)
Any ideas on what else I can try?
A few questions:
Describe the bug When I run the following code in an RScript it works just find and produces a map with a legend in the bottom left corner as I would expect. When I run the exact same code in an RMarkdown file the legend no longer appears. When I inspect the generated html the
legendContainerhtmlwidget
is empty, suggesting that there is some problem with how the html is generated, rather than something to do with styling.To Reproduce Here is the code i run.
The data is really simple, just the following columns lat,lon,count.
Thanks in advance!