北京经济技术开发区经开区虚拟城市项目-【前端】-Web
Jin Lei
2023-12-23 5df6240f6cd274e698d1e6358443364d543c126c
src/components/menu/bottom-menu.vue
@@ -90,6 +90,8 @@
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
@@ -294,7 +296,9 @@
import axios from "axios";
export default {
  components: {},
  components: {
  },
  name: "bottom-menu",
  data() {
    return {
@@ -303,6 +307,7 @@
      isShowSPRH: true,
      csbjShow: false,
      jxmxShow: false,
      romanOption: [
        { name: "核心区" },
        { name: "景观绿地" },
@@ -582,52 +587,17 @@
    shoujixinling() {
      this.switchMenu(3);
      if (this.isShowSjxl) {
        const loading = this.$loading({
          lock: true,
          text: "手机信令数据加载中,请稍后",
          spinner: "el-icon-loading",
          background: "rgba(0, 0, 0, 0.7)",
        });
        setTimeout(() => {
          loading.close();
        }, 1500);
        this.isShowSjxl = false;
        let heatMapUrl = URLInCode.heatMapUrl;
        sgworld.Core.getJSON(heatMapUrl, (data) => {
          let res = [];
          data.features.forEach((item) => {
            let obj = {
              x: item.properties["center_x"],
              y: item.properties["center_y"],
              value: item.properties["sd_total"],
              radius: 50,
            };
            res.push(obj);
          });
          // //创建热力图
          heatMapItem = sgworld.Creator.addHeatMap("热力图", {
            type: "Heatmap", // 热力图类型【Heatmap/HeatmapGL】(可选)
            sourceData: res,
            radius: 7,
            gradient: {
              ".3": "blue",
              ".5": "green",
              ".7": "yellow",
              ".95": "red",
            },
            tooltip: true, // tooltip显示数值
          });
        });
        this.$parent.signallingShow = true;
      } else {
        this.closeSjxl();
      }
    },
    closeSjxl() {
      if (heatMapItem) {
        this.isShowSjxl = true;
        heatMapItem.deleteObject();
      }
        this.$parent.signallingShow = false;
    },
    // historyHandle() {
    //   this.$store.commit("showHistory", true);