Update the removeMarker function to check for an instance of L.Marker.
if (layer instanceof L.Marker)...
The current approach assumes an L.Marker if there is a getLatLng() method. This means that it could unintentionally remove a L.GeodesicCircle object as well.
Update the removeMarker function to check for an instance of L.Marker.
if (layer instanceof L.Marker)...
The current approach assumes an L.Marker if there is a getLatLng() method. This means that it could unintentionally remove a L.GeodesicCircle object as well.