Closed dwachsmuth closed 2 years ago
Your reprex looks ok, so I assume that the problem is data.
The default colour for NA is black, so this suggests that the field doesn't exist, is not numeric, or all values are null / nan. You can easily verify this by making the layer pickable and adding a tooltip.
Example using country boundaries:
rdeck() |>
add_mvt_layer(
data = mvt_url("mapbox.country-boundaries-v1"),
get_fill_color = scale_color_linear(
col = color_group,
palette = viridis::viridis(6),
limits = c(1, 6)
),
auto_highlight = TRUE,
pickable = TRUE,
tooltip = TRUE
)
You might also try looking at the tile json, which you can access via: https://api.mapbox.com/v4/dwachsmuth.borough_5.json?access_token=<your token>
Arrgh, sorry, you're right—I had a misnamed field. Many apologies for not triple-checking that ahead of time!
(I had previously tried to make it pickable to do this exact verification, but that didn't work either, presumably because I had misnamed the field....)
Apologies if I'm missing something obvious, but I can't figure out how to set the fill colour of an MVT layer with a scale referencing a data field in the MVT source.
I've got:
Which I hope would scale the fill colour with reference to the "canale_ind_2016" field present in my MVT data source, but instead all polygons are filled with the fallback colour (black).
Is there some way to accomplish this?