score:1

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

poligono
    .filter(function (o) { return d.id === o.properties.Name; })
    .attr('opacity', 1);

Or a one liner

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

Related Query

More Query from same tag