CartoDB / mobile-carto-libs

Internal dependencies for CARTO Mobile SDK
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

placement-priority for lines/polygons #19

Closed farfromrefug closed 2 years ago

farfromrefug commented 3 years ago

I would like a way to make the "selected" item within a GeoJSON layer always appear on top of others. I think placement-priority could do that. Could you add it for line/polygon? BTW is there a value to "disable" placement-priority? is "none" supported like it is in carto css? That way i could do

line-placement-priority: [nuti::selected_id]=[id] ? 1000 : none;
mtehver commented 3 years ago

It would be very hard to implement that. Processing of labels is very different from lines/polygons. Rendering of lines, polygons and basic points scales easily to hundreds of thousands features, while label processing really scales to few thousands.

farfromrefug commented 3 years ago

@mtehver so there is no way to say draw this polyline last?

mtehver commented 3 years ago

No way unfortunately. I suggest adding another layer for selected elements that is simply rendered on top of existing layers. So I would keep selection logic separate from base layer styling.

farfromrefug commented 3 years ago

@mtehver yes but i cant do it without this https://github.com/CartoDB/mobile-carto-libs/issues/20 ;) The idea is to do it for the "selected" polyline. I need a way to do something like :

[id=[nuti::selected_id]]::selected {
}
farfromrefug commented 2 years ago

solved with when