Home  >  Article  >  Web Front-end  >  Baidu Map cancels custom marker overlays

Baidu Map cancels custom marker overlays

php中世界最好的语言
php中世界最好的语言Original
2018-03-23 10:55:371700browse

This time I will bring you BaidumapCancel custom markercovering, Baidu MapNotesYes Which ones, the following are practical cases, let’s take a look.

is as follows:

var marker = new BMap.Marker(...);
//方法1
map.removeOverlay(marker);
//方法2
marker.remove(); 
//如果是Marker设置的setLabel还可以设置其样式来隐藏 
mapComponent.state.bikeMarkLabel.setStyle({
  display:"none"
}); 41787

The label method is the same as the marker.

It is recommended to use method 1 and method 2. Method 3 is just to hide but not clear

I believe you have mastered the method after reading the case in this article, and there will be more exciting things. Please pay attention to other related articles on php Chinese website!

Recommended reading:

How to develop a WeChat applet to obtain user personal information

Vue2.5 and Element UI component paging function realizes

js dynamic operation table

The above is the detailed content of Baidu Map cancels custom marker overlays. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn