liuyg
2022-03-02 e7c6c4eecddae9515b0cd1be68335690843df3d1
src/store/modules/popupParams.js
@@ -19,7 +19,10 @@
        teachList: [],
        liveList: [],
        addTagPopup: false,
        addTagPosition: null
        addTagPosition: null,
        labelLayer: null, //自定义标签图层
        addSignList: true,
    },
    mutations: {
        SET_POPUPBGURL (state, popupBgUrl) {
@@ -81,6 +84,48 @@
        SET_ADDTAGPOSITION (state, addTagPosition) {
            state.addTagPosition = addTagPosition
        },
        initLabelLayer(state, val) {
            if (!state.labelLayer) {
                state.labelLayer = new global.DC.HtmlLayer("labelLayer");
                val.addLayer(state.labelLayer);
            }
        },
        addLabelLayerIcon(state, val) {
            let list = val.list;
            if (val.clear) {
                //     state.labelLayer.remove();
                state.labelLayer.clear();
            }
            if (val.add) { //刷新列表
                state.addSignList = !state.addSignList;
            }
            for (let i in list) {
                console.log(list[i], 112233)
                const divIcon = new global.DC.DivIcon(
                    new global.DC.Position(
                        Number(list[i].jd),
                        Number(list[i].wd),
                        0
                    ),
                    `
                              <div class="tag-entitys-box">
                                  <div class="tag-content">
                                      ${list[i].name}
                                  </div>
                                  <div class="tag-angle-content">
                                      <img src="https://map.hit.edu.cn/images/tarrow_xq.png">
                                  </div>
                              </div>
                          `
                );
                state.labelLayer.addOverlay(divIcon);
            }
        },
        clearLabelLayerIcon(state, val) {
            if (state.labelLayer) {
                state.labelLayer.clear();
            }
        },
        CLEAR_ALL (state, param) {
            state.siteName = param