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

Baidu Map cancels custom marker overlays

php中世界最好的语言
Release: 2018-03-23 10:55:37
Original
1733 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template