百度地圖,標記,顯示和隱藏的方法


data中定義

zhanList: [{ title: '實踐中心', show: true, }, { title: '實踐所', show: true, }, { title: '實踐站', show: true, }, { title: '實踐點', show: true, } ], serviceList: [{ title: '未開始', show: true, }, { title: '進行中', show: true, }, { title: '已結束', show: true, } ], 

方法

hideMarker(data, show) {
        if (data === "實踐中心") {
          this.centerArr.map((val) => {
            if (show) {
              val.marker.hide();
              val.label.hide();
            } else {
              val.marker.show();
              val.label.show();
            }
            this.zhanList[0].show = !show;
          });
      },

 



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM