Open farfromrefug opened 3 years ago
Not sure this is the best way to do it. I am currently thinking about adding CartoCSS support for raster tiles. Thus it would be possible to mix vector tile layers and raster layers in a more unified way. Opacity functions, comp-op support would come automatically with this.
@mtehver that sounds intersting ;). What i was thinking about recently was to be able to usr expression for all properties in vector elements. Working in many apps with Carto we feel more and more "constrained" by classical vector elements compared to vector tiles. And expressions are what makes the biggest difference. If we could have some kind of carto css theming for those the possibilities would be endless (navigation arrows, borders, text along lines ...). This is why i am thinking of migration my local vector layers to geojson layers( with possible PRs on the way ;))
The idea came from how mapbox handles hillshade layers properties. In mapbox you can define an expression for any property. I think it would be amazing to be able to use something like
linear([view::zoom], (4, 10), (8, 20))
in a number property likeopacity
for layers and such. I am not sure if it should be a new method or if we could use the same exisisting method:setOpacity
orsetOpacityExpression
. I am a bit worried about the latter as in the end it would increase the lib sizeI think it would be fairly easy to implement for hillshade layer. If you are ok with the idea i could have a go at it. Once the concept seems good we could extend it to all vector elements