How to solve the problem of repeated invocation of Baidu Map Label binding mouseover method

problem description

In the

project, there is a function of finding houses on a map. The mouse hovers over the overlay to display administrative regions, remove and cancel administrative regions, similar to the following figure.
because Baidu Maps is used, the overlay implemented by api with text label label is checked. Later, it is found that label does not support the mouseenter method.
only the mouserover method, but there will be problems with the mouseover method. The mouse movement will repeatedly add administrative regions, and it is useless for
to make its own judgment with flag. It will still be repeated.

ask the boss for advice on how to keep mouseover from repeating, or point out what"s wrong with my thinking and how to achieve it. Thank you very much!

   label.onmouseover = function (e) {
        console.log(task)
        if (task) {
            var lab = e.currentTarget;
                getBoundary(lab);
                task = false;
            }
        };

clipboard.png

Apr.25,2021

lablel plus a state judgment is already enter.

label.enter = false
 label.onmouseover = function (e) {
    if (label.enter ) {
        return
    }
    label.enter = true
    console.log(task)
    if (task) {
        var lab = e.currentTarget;
            getBoundary(lab);
            task = false;
        }
    };
}

then set this state to false when mouseout

Menu