Accepted answer

the following is a better polygon check but it looks like none of the names in the legend is found in the names of the Polygons

Better to change the opacity in case you want to stroke the polygons. Also change where you create the red polygons

    .filter(function (o) { return ===; })
    .attr('opacity', 1);

Or a one liner

poligono.attr('opacity', o => === ? 1 : 0);

Related Query

More Query from same tag