I draw circles and polygons on Google maps using DrawingManager. I tried to remove a circle/polygon by using the below code.
selectedShape.setMap(null);
Here selectedShape is either circle or polygon.
But it just hides the shape from the view. Internally that shape present in DOM. For example: I have drawn 2 circles and 2 polygons. Now the total of shapes is 4. If I remove a circle or polygon, the count is still 4. It's not removed from DOM. Just hidden.
I want to completely remove a selected shape out of many shapes.