I am making a geotool application in which I read the data from postgresql database. In this application if i make a buffer on a selected polygon then a buffer is created and buffer layer shown in layer table of JMapFrame. After that i make another buffer on another polygon then there are two layers with same name shown in the layer table in JMapFrame and both the layers shows the buffer on last selected polygon. How can I replace the same name layer with the new one from the layer table in JMapFrame.
In this JMapFrame all the khasra_buffer layers are the same i.e. the current buffer which is created at Id 80, Thus replacing previously created two buffers.
I want that old khasra_buffer layer should be removed and the only buffer layer that should be shown is of the current buffer on JMapframe.