This article mainly introduces how to use javascript to display and hide Baidu map mouse sliding events. it is very practical. we recommend this article to our friends who need it for reference. The implementation idea is to set the style for the label. let's take a look at the specific practices.
Var label = new BMap. label ("I'm a text note", {offset: new BMap. size (20,-10)}); label. setStyle ({display: "none" // set the style for the label, any CSS is acceptable}); marker. setLabel (label); marker. addEventListener ("mouseover", function () {label. setStyle ({// set the style for the label. Any CSS can be displayed: "block"}); marker. addEventListener ("mouseout", function () {label. setStyle ({// set the style for the label. Any CSS can be displayed: "none "});});
The above is all the content shared in this article. I hope it will help you learn javascript.