Open charandas opened 5 years ago
@charandas this is an interesting idea. Definitely makes me wish we got better errors for invalid styles than we do now.
I'm open to your idea of using a preRender
function - but I don't have the time at the moment to implement that. Open to PRs, if you want to rough out something along these lines.
I would love to be able to do
map.setPaintProperty
before this library callsmap.render
to give me thepng
output.The motivation would be that runtime styling in GL JS actually returns proper errors like:
Whereas if my
style.json
has an incorrect color like that, it just fails silently to apply the expression to say,fill-color
.Also, run-time styling would be nice for the calling-user as they won't be interfacing with
style.json
but instead have access to allmap
APIs supported by gl-native. Also, for context, runtime styling options for node seem to be mature and have been in support since at least 2017.