Cesium在3dtiles三維模型上添加標注


 1     let i = 0;
 2     PinBill.prototype.createBill = function () {
 3       let that = this;
 4       that.entity = viewer.entities.add({
 5         id: '實體' + i++,
 6         position: that.myPos,
 7         billboard: {
 8           image: that.myCanvas,
 9           scale: 0.4,
10           verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
11           disableDepthTestDistance: new Cesium.CallbackProperty((time, result) => {
12             let cp = viewer.camera.positionWC.clone();
13             let d = Cesium.Cartesian3.distance(cp, that.myPos);
14             if (d < 60) {
15               that.entity.billboard.eyeOffset=new Cesium.Cartesian3(0, 0, -d+1);
16               return Number.POSITIVE_INFINITY;
17             } else {
18               return undefined;
19             }
20           }, false),
21           eyeOffset: new Cesium.Cartesian3(0, 0, -50)
22         }
23       });
24     }

 


免責聲明!

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



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