I'm working with a tkinter canvas to build a geospatial project with an area containing randomly placed points. I'm using a rectangle for interaction and implementing a quadtree algorithm within this rectangle. I'm encountering an issue when this rectangle is moved; the quadtree from the old position isn't cleared. I've tried using canvas.delete('quadtree') but it doesn't work. Similarly, canvas.delete('all') to redraw all objects with new parameters also doesn't seem to function. Do you have any suggestions on what I should do?
I attempted to delete the old quadtree in the tkinter canvas by using canvas.delete('quadtree') after the rectangle was moved. My expectation was that this action would remove the previous quadtree from the canvas. However, despite this attempt, the old quadtree wasn't removed, and the canvas continued to display the previous quadtree along with the new one.