// markers saved here
var currentMarkers=[];
// tmp marker
var oneMarker= new mapboxgl.Marker(currentMarkerDiv)
.setLngLat(marker.geometry.coordinates)
.addTo(mapboxMap);
// save tmp marker into currentMarkers
currentMarkers.push(oneMarker);
// remove markers
if (currentMarkers!==null) {
for (var i = currentMarkers.length - 1; i >= 0; i--) {
currentMarkers[i].remove();
}
}