I need to implement a multicolor fill in a polygon feature. The fill will be conditionally formatted according to feature properties.
Let's say that I need a polygon with a 3-color pattern like this:
let fillPalette = ['orange', 'green', 'blue'];
How is this possible in Leaflet?
In a simple div, this could be easily achieved with the following CSS function:
background: repeating-linear-gradient(
-45deg,
orange,
orange 10px,
green 10px,
green 20px,
blue 20px,
blue 30px
);
However, Leaflet uses SVG/Canvas.
I am aware of the following plugins:
Unfortunately, the first doesn't seem to support multi-color patterns and the second supports only images.
Any ideas?
