Baidu map API map.removeOverlay () can not clearly marker

        var map = new BMap.Map("allmap");
        var start = new BMap.Point(114.02597366,22.54605355);
        var end = new BMap.Point(114.22597366, 22.59605355);
        var driving = new BMap.DrivingRoute(map, { 
            renderOptions: { 
                map: map, 
                autoViewport: true,
                onMarkersSet:function(routes){
        map.removeOverlay(routes[0].marker);//
        map.removeOverlay(routes[1].marker);//
        }
            }
        });
        driving.search(start, end);

result

Why is it useless for me to perform a clear operation here?

Mar.29,2021

var map = new BMap.Map("allmap");
var start = new BMap.Point(114.02597366,22.54605355);
var end = new BMap.Point(114.22597366, 22.59605355);
var driving = new BMap.DrivingRoute(map, { 
    renderOptions: { 
        map: map, 
        autoViewport: true
    },
    onMarkersSet:function(routes) {
        map.removeOverlay(routes[0].marker); //
        map.removeOverlay(routes[1].marker);//
    }
});
driving.search(start, end);

reference http://lbsyun.baidu.com/cms/j.
onMarkersSet is a parameter of DrivingRouteOptions, not a parameter of renderOptions

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c20bfd-32d66.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c20bfd-32d66.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?