0

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

Browse other questions tagged or ask your own question.