0
votes

I'm trying to make geojson layer of polygons with diffrent fills. Some of them need to use "fill-patern" so they have "fill-patern" property, but some of them don't. I'm getting both of the "fill-patern" and "fill-color" proreties by expressions:

   paint: {
            "fill-pattern": ["get", "fill-pattern"],
            "fill-color": ["get", "fill-color"],
          },

But "fill-patern" property with any value (even null, or undefined) makes layer ignore "fill-color" property of this feature. So is that possible to fully ignore property if feature doesn't have it?

1

1 Answers

0
votes

You're correct that, as noted in the documentation for the fill-color property here, fill-color is disabled by fill-pattern. In this scenario, the best approach would be to make two separate layers, one for the polygons that need to use fill-pattern and one for the polygons that don't. You could either use the same source for each layer and apply a filter expression as needed, or break up your original source into two separate sources.