Open nvkelso opened 5 years ago
@bcamper I nominate this for v0.17 milestone :)
Confirmed fractional priorities work in Tangram JS already. So no code change :) Documentation should be updated, I'll leave this open for that -- but perhaps wait until it is supported in ES too, so we don't have to update twice?
So what we will want in the scene file is:
priority: function(){ return feature.min_zoom + (1 - 1 / feature.collision_rank) * 0.1; }
Following up from https://github.com/tilezen/vector-datasource/issues/988, it sounds like Tangram JS does support float values on the priority property (but Tangram ES does not currently). Let's verify that and if so update the documentation. Else add support and document.
This comment is the tl;dr:
Specifically, this should allow a function like (which returns a float):
Alternatively we've also talked about multi-key
priority
which could give more performance than a JS function. For example:Though in some other cases (like name) we treat lists as fallbacks not tie breakers.