how to add new polygon layers to already drawn ones

43 Views Asked by At

how to add new polygons to an existing layer, so as not to completely redraw, but only add new ones?

the current code completely redraws the entire layer, but it is necessary for new zones to be added and drawn to the old ones

 newZones.forEach((zone) => {
        L.polygon(zone.points, getNeighboursStyle(zone))
          .bindTooltip(zone.name, {
            sticky: true,
          })
          .on('click', () => handleSelectZone(zone))
          .addTo(mapZones.current)
      })
0

There are 0 best solutions below