| | |
| | | }, |
| | | |
| | | 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) |
| | | // }); |
| | | 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: this.getName(poi), |
| | | text: poi.name,//this.getName(poi), |
| | | font: "22pt monospace", |
| | | outlineWidth: 2, |
| | | fillColor: SmartEarth.Cesium.Color.YELLOW, |
| | | lon: poi._x, |
| | | lat: poi._y, |
| | | 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) { |
| | | const modelLayer = mapServer.listData.filter((res) => { |