Complex marker logic
See original GitHub issueI have a question about a relatively complex marker logic situation.
You have several (small amount) types of features on a table. You want to represent each one of these with a particular icon.
This is solved with a symbol ramp:
symbol: ramp(buckets($category, ['primary', 'secondary']), [image(primaryUrl), image(secondaryUrl)], image(fallback))
So, we are mapping the icon on one dimension, the $category.
Imagine now we want to highlight a particular feature, by changing its marker. Maybe a different version of the marker associated with its category.
How would you approach this?
I thought of a couple of things
Approach 1 - If expression
Not knowing anything about internals. Would an if operator be feasible?
if(condition, expression_for_true, expression_for_false)
The condition could be $cartodb_id == ${selectedId} The first expression could be the ramp for highlighted markers based on category The second expression could be the ramp for non-highlighted markers based on category.
This approach reminds me of doing spreadsheets 😬
Approach 2 - Composed variables
What if we could create interpolated like this:
$category_${selectedId == $cartodb_id}
Then the ramp would map: primary_1, primary_0, secondary_1, secondary_0 to primaryUriSelected, primaryUri, secondaryUriSelected, secondaryUri
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (10 by maintainers)
Top GitHub Comments
Hello @pedrohb88, let’s see if we can prioritize these issues related with the
blendTo
method and the texture units used. Thanks!@rjimenezda, I think what’s missing here is no longer how to solve the initial problem but the fact that we have some errors regarding freeing resources at WebGL side. If you are OK, I’m gonna close this issue a create a new one to address the issue with the out of range textures problem: