def _redo(self, c4: Column): if c4.button("Redo"): self.map = self._get_map() self.current_wp = min(self.current_wp + 1, len(self.waypoints)) for wp in self.waypoints[:self.current_wp]: wp.marker.add_to(self.map) self._add_lines(self.waypoints[:self.current_wp])
def _undo(self, c4: Column): if c4.button("Undo"): self.map = self._get_map() self.current_wp = max(self.current_wp - 1, 0) for wp in self.waypoints[:self.current_wp]: wp.marker.add_to(self.map) self._add_lines(self.waypoints[:self.current_wp])