Merge branch 'develop' of http://xny.yj-3d.com:3000/zh/sdk4.0 into develop

This commit is contained in:
zh
2025-07-15 10:38:05 +08:00
16 changed files with 53 additions and 18 deletions

View File

@ -587,8 +587,6 @@ class Tools {
getMaterial(color = '#2ab0c2', type = 0, entity = null, newParam = {}) {
let material = ''
switch (Number(type)) {
case 1: //虚线
@ -647,7 +645,18 @@ class Tools {
space: newParam.space,
speed: newParam.speed
}
let arr = {
'7': 10,
'8': 3,
'9': 4,
'10': 4,
'11': 4,
'12': 2
}
param.speed = newParam.rotate ? param.speed : 0 - param.speed
console.log(entity.polyline.oriWidth, arr[type + ''], type, 'oriWidth')
entity.polyline.width = entity.polyline.oriWidth + arr[type + '']
this.getFlowTexture(this, param, entity)
break
@ -684,6 +693,8 @@ class Tools {
// let repeat = getRepeat()
// }, false)
entity.polyline.material.oriRepeat = undefined
entity.polyline.material.oriSpeed = undefined
entity.polyline.material = new Cesium.LineTextureMaterialProperty(
{
color: options.color,
@ -697,8 +708,8 @@ class Tools {
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
if (!Cesium.defined(positions)) {
// return new Cesium.Cartesian2(1.0, 1.0);
return 1.0;
return new Cesium.Cartesian2(1.0, 1.0);
// return 1.0;
}
var distance = 0;
@ -722,14 +733,21 @@ class Tools {
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
let speed
if (entity.polyline.material.oriRepeat) {
speed = repeatX / entity.polyline.material.oriRepeat
} else {
entity.polyline.material.oriRepeat = repeatX
}
// if (repeatX < 3) {
// repeatX = 3
// }
// return new Cesium.Cartesian2(repeatX, 1.0);
return repeatX;
return new Cesium.Cartesian2(repeatX, speed || 1.0);
// return repeatX;
})
}
)
entity.polyline.material.oriSpeed = options.speed
}
}