yxl
2025-01-02 c0ff61d066a9f65aa0cdbeb1e10a249763f1e966
src/assets/js/mapSetFunc.js
@@ -153,37 +153,31 @@
  },
  creatPoiMap(res) {
    const poi = res.data;
    // const label = earthCtrl.factory.createLabel({
    //   lon: poi._x,
    //   lat: poi._y,
    //   text: this.getName(poi),
    //   alt: 150,
    //   image: SmartEarthRootUrl + "Workers/image/fighter.png",
    //   // 文本偏移量
    //   pixelOffset: new SmartEarth.Cesium.Cartesian2(0, -50),
    //   // 图片偏移量
    //   iPixelOffset: new SmartEarth.Cesium.Cartesian2(0, -20)
    // });
    const label = earthCtrl.factory.createLabel({
      name: "创建文本",
      id: earthCtrl.factory.createUUID(),
      text: this.getName(poi),
      font: "22pt monospace",
      outlineWidth: 2,
      fillColor: SmartEarth.Cesium.Color.YELLOW,
      lon: poi._x,
      lat: poi._y,
      alt: poi.height ? poi.height + 10 : 100,
      iDistanceDisplayCondition: (100, 3000)
    });
    setTimeout(() => {
      this.setEntityTitlesChangeColor(poi.seid);
    }, 200);
    earthCtrl.userScene.flyTo(label);
    this.layerList.push({
      layer: label,
      func: res.func
    res.data.forEach((poi,index) => {
      // const poi = res.data[0];
      console.log('poi------', poi)
      const label = earthCtrl.factory.createLabel({
        name: "创建文本",
        id: earthCtrl.factory.createUUID(),
        text: poi.name,//this.getName(poi),
        font: "22pt monospace",
        outlineWidth: 2,
        fillColor: SmartEarth.Cesium.Color.YELLOW,
        lon: poi.lontitude,
        lat: poi.lattitude,
        alt: poi.height ? poi.height + 10 : 100,
        iDistanceDisplayCondition: (100, 3000)
      });
      setTimeout(() => {
        this.setEntityTitlesChangeColor(poi.seid);
      }, 200);
      if (index == 0) {
        earthCtrl.userScene.flyTo(label);
      }
      this.layerList.push({
        layer: label,
        func: res.func
      });
    });
  },
  setEntityTitlesChangeColor(res) {