Merge branch 'develop' of http://xny.yj-3d.com:3000/zh/sdk4.0
@ -96,10 +96,9 @@ function html(that) {
|
|||||||
<input class="btn-switch" type="checkbox" @model="rotate">
|
<input class="btn-switch" type="checkbox" @model="rotate">
|
||||||
</div>
|
</div>
|
||||||
<div class="col" style="flex: 0 0 33%;">
|
<div class="col" style="flex: 0 0 33%;">
|
||||||
<span class="label">动画时长</span>
|
<span class="label">流动速率</span>
|
||||||
<div class="input-number input-number-unit-1" style="width: 80px;">
|
<div class="input-number input-number-unit-1" style="width: 80px;">
|
||||||
<input class="input" type="number" title="" min="0" max="999999" step="0.1" @model="speed">
|
<input class="input" type="number" title="" min="0" max="999999" step="1" @model="speed">
|
||||||
<span class="unit">s</span>
|
|
||||||
<span class="arrow"></span>
|
<span class="arrow"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -177,7 +177,8 @@ class PolylineObject extends Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set speed(v) {
|
set speed(v) {
|
||||||
this.options.speed = v
|
// this.options.speed = v
|
||||||
|
this.options.speed = v !== 0 ? Math.pow(v, -1) * 100 : 0
|
||||||
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
|
this.entity.polyline.material = this.getMaterial(this.options.color, this.options.type, this.entity, this.options)
|
||||||
}
|
}
|
||||||
get dashSize() {
|
get dashSize() {
|
||||||
@ -1321,6 +1322,7 @@ class PolylineObject extends Base {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
that.entity.polyline.oriWidth = that.options.width
|
that.entity.polyline.oriWidth = that.options.width
|
||||||
|
that.judgeLine(that.entity, that.options)
|
||||||
that.sdk._entityZIndex++
|
that.sdk._entityZIndex++
|
||||||
PolylineObject.createLabel(that)
|
PolylineObject.createLabel(that)
|
||||||
// that.entity.polyline.positionsLngLat = positions
|
// that.entity.polyline.positionsLngLat = positions
|
||||||
@ -1355,7 +1357,102 @@ class PolylineObject extends Base {
|
|||||||
|
|
||||||
let scene = that.sdk.viewer.scene
|
let scene = that.sdk.viewer.scene
|
||||||
}
|
}
|
||||||
|
judgeLine(entity, newParam) {
|
||||||
|
if (!entity.polyline.oriRepeat) {
|
||||||
|
let param = {
|
||||||
|
color: newParam.color,
|
||||||
|
image: this.getSourceRootPath() + `/img/arrow/1.png`,
|
||||||
|
space: newParam.space,
|
||||||
|
speed: newParam.speed
|
||||||
|
}
|
||||||
|
|
||||||
|
param.speed = newParam.rotate ? param.speed : 0 - param.speed
|
||||||
|
|
||||||
|
const canvasEle = document.createElement('canvas');
|
||||||
|
const ctx = canvasEle.getContext('2d')
|
||||||
|
const myImg = new Image()
|
||||||
|
// myImg.src = that.getSourceRootPath() + '/img/arrow/1.png'
|
||||||
|
myImg.src = param.image
|
||||||
|
let that = this
|
||||||
|
myImg.onload = function () {
|
||||||
|
canvasEle.width = myImg.width * (param.space + 1)
|
||||||
|
canvasEle.height = myImg.height
|
||||||
|
|
||||||
|
let oriRepeat = that.getSceenLine(entity, param, canvasEle)
|
||||||
|
oriRepeat && (entity.polyline.oriRepeat = oriRepeat)
|
||||||
|
|
||||||
|
|
||||||
|
var positionProperty = entity.polyline.positions;
|
||||||
|
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
||||||
|
|
||||||
|
if (!Cesium.defined(positions)) {
|
||||||
|
return new Cesium.Cartesian2(1.0, 1.0);
|
||||||
|
// return 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var distance = 0;
|
||||||
|
for (var i = 0; i < positions.length - 1; ++i) {
|
||||||
|
distance += Cesium.Cartesian3.distance(positions[i], positions[i + 1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var repeatX = distance / entity.polyline.width.getValue();
|
||||||
|
// 根据地图缩放程度调整repeatX
|
||||||
|
var cameraHeight = that.sdk.viewer.camera.positionCartographic.height;
|
||||||
|
var boundingSphere = new Cesium.BoundingSphere(
|
||||||
|
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||||
|
500000 // 半径(距离)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||||
|
var drawingBufferWidth = that.sdk.viewer.canvas.clientWidth;
|
||||||
|
var drawingBufferHeight = that.sdk.viewer.canvas.clientHeight;
|
||||||
|
|
||||||
|
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||||
|
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||||
|
repeatX *= groundResolution / cameraHeight / (param.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||||
|
// if (entity.polyline.material.oriRepeat) {
|
||||||
|
let speed = repeatX / entity.polyline.oriRepeat
|
||||||
|
entity.polyline.oriSpeed = speed
|
||||||
|
entity.polyline.oriRepeatX = repeatX
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**获取当前满屏横线速度 */
|
||||||
|
getSceenLine(entity, options, canvasEle) {
|
||||||
|
let point1 = new Cesium.Cartesian2(0, this.sdk.viewer.canvas.clientHeight)
|
||||||
|
let point2 = new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth / 2, this.sdk.viewer.canvas.clientHeight)
|
||||||
|
var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||||
|
var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||||
|
|
||||||
|
var distance = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||||
|
|
||||||
|
var repeatX = distance / entity.polyline.width.getValue();
|
||||||
|
// 根据地图缩放程度调整repeatX
|
||||||
|
var cameraHeight = this.sdk.viewer.camera.positionCartographic.height;
|
||||||
|
var boundingSphere = new Cesium.BoundingSphere(
|
||||||
|
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||||
|
500000 // 半径(距离)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||||
|
var drawingBufferWidth = this.sdk.viewer.canvas.clientWidth;
|
||||||
|
var drawingBufferHeight = this.sdk.viewer.canvas.clientHeight;
|
||||||
|
|
||||||
|
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||||
|
var groundResolution = this.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||||
|
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
|
||||||
|
if (groundResolution > 700) {
|
||||||
|
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||||
|
} else {
|
||||||
|
repeatX = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return repeatX
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 编辑框
|
* 编辑框
|
||||||
* @param {boolean} state true打开,false关闭
|
* @param {boolean} state true打开,false关闭
|
||||||
|
@ -10,12 +10,14 @@ function FlowDashedLine() {
|
|||||||
this._uType = undefined;
|
this._uType = undefined;
|
||||||
this._space = undefined;
|
this._space = undefined;
|
||||||
this._dashSize = undefined;
|
this._dashSize = undefined;
|
||||||
|
this._scale = undefined;
|
||||||
this.color = new Cesium.Color.fromCssColorString(options.color || "rgba(255,255,255,1)");
|
this.color = new Cesium.Color.fromCssColorString(options.color || "rgba(255,255,255,1)");
|
||||||
this.speed = options.speed != undefined ? options.speed : 1.0;//速度
|
this.speed = options.speed != undefined ? options.speed : 1.0;//速度
|
||||||
this.space = options.space || 0.0;//速度
|
this.space = options.space || 0.0;//速度
|
||||||
this.dashSize = options.dashSize || 0.03;//速度
|
this.dashSize = options.dashSize || 0.03;//速度
|
||||||
this.uType = options.uType === undefined ? 1 : options.uType;//类型:0:普通流动线 1:虚化虚线
|
this.uType = options.uType === undefined ? 1 : options.uType;//类型:0:普通流动线 1:虚化虚线
|
||||||
this.lineBackAlpha = options.lineBackAlpha || 0.05;
|
this.lineBackAlpha = options.lineBackAlpha || 0.05;
|
||||||
|
this.scale = options.scale || 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isConstant() {
|
get isConstant() {
|
||||||
@ -65,6 +67,12 @@ function FlowDashedLine() {
|
|||||||
1,
|
1,
|
||||||
result.uType
|
result.uType
|
||||||
);
|
);
|
||||||
|
result.scale = Cesium.Property.getValueOrDefault(
|
||||||
|
this._scale,
|
||||||
|
time,
|
||||||
|
1.0,
|
||||||
|
result.scale
|
||||||
|
);
|
||||||
result.lineBackAlpha = this.lineBackAlpha;
|
result.lineBackAlpha = this.lineBackAlpha;
|
||||||
result.frameNumber = Cesium.getTimestamp();
|
result.frameNumber = Cesium.getTimestamp();
|
||||||
return result;
|
return result;
|
||||||
@ -77,7 +85,8 @@ function FlowDashedLine() {
|
|||||||
Cesium.Property.equals(this._color, other._color) &&
|
Cesium.Property.equals(this._color, other._color) &&
|
||||||
Cesium.Property.equals(this._speed, other.speed) &&
|
Cesium.Property.equals(this._speed, other.speed) &&
|
||||||
Cesium.Property.equals(this._uType, other.uType) &&
|
Cesium.Property.equals(this._uType, other.uType) &&
|
||||||
Cesium.Property.equals(this.lineBackAlpha, other.lineBackAlpha))
|
Cesium.Property.equals(this._lineBackAlpha, other.lineBackAlpha) &&
|
||||||
|
Cesium.Property.equals(this._scale, other.scale))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,6 +98,7 @@ function FlowDashedLine() {
|
|||||||
dashSize: Cesium.createPropertyDescriptor("dashSize"),
|
dashSize: Cesium.createPropertyDescriptor("dashSize"),
|
||||||
uType: Cesium.createPropertyDescriptor("uType"),
|
uType: Cesium.createPropertyDescriptor("uType"),
|
||||||
transparency: Cesium.createPropertyDescriptor("lineBackAlpha"),
|
transparency: Cesium.createPropertyDescriptor("lineBackAlpha"),
|
||||||
|
scale: Cesium.createPropertyDescriptor("scale"),
|
||||||
});
|
});
|
||||||
|
|
||||||
Cesium.FlowDashedLineFlowMaterialProperty = FlowDashedLineFlowMaterialProperty;
|
Cesium.FlowDashedLineFlowMaterialProperty = FlowDashedLineFlowMaterialProperty;
|
||||||
@ -108,7 +118,7 @@ function FlowDashedLine() {
|
|||||||
float dashSize = 0.1;
|
float dashSize = 0.1;
|
||||||
float gapSize = space;
|
float gapSize = space;
|
||||||
// speed现在表示完成一次完整动画循环的秒数
|
// speed现在表示完成一次完整动画循环的秒数
|
||||||
float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed);
|
float progress = speed==0.0 ? 0.0 : fract(frameNumber / 1000.0 / speed * scale);
|
||||||
float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));
|
float pattern = fract(st.x / dashSize * (1.0 + gapSize) + progress / dashSize * (1.0 + gapSize));
|
||||||
float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);
|
float dash1 = step(0.0, pattern) - step(1.0/(1.0 + gapSize), pattern);
|
||||||
float dash2 = smoothstep(0.0, 0.2, pattern) -
|
float dash2 = smoothstep(0.0, 0.2, pattern) -
|
||||||
@ -131,6 +141,7 @@ function FlowDashedLine() {
|
|||||||
color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
|
color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
|
||||||
speed: 1,
|
speed: 1,
|
||||||
space: 0.0,
|
space: 0.0,
|
||||||
|
scale: 1.0,
|
||||||
dashSize: 0.03,
|
dashSize: 0.03,
|
||||||
frameNumber: Cesium.getTimestamp(),
|
frameNumber: Cesium.getTimestamp(),
|
||||||
uType: 1,
|
uType: 1,
|
||||||
|
@ -202,7 +202,7 @@ class Tools {
|
|||||||
return length.toFixed(fractionDigits)
|
return length.toFixed(fractionDigits)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
computeDistance2(positions = [], fractionDigits = 2, ground = true) {
|
computeDistance2(positions = [], fractionDigits = 2, ground = true) {
|
||||||
if (positions.length < 2) {
|
if (positions.length < 2) {
|
||||||
return 0
|
return 0
|
||||||
@ -586,6 +586,17 @@ class Tools {
|
|||||||
|
|
||||||
getMaterial(color = '#2ab0c2', type = 0, entity = null, newParam = {}) {
|
getMaterial(color = '#2ab0c2', type = 0, entity = null, newParam = {}) {
|
||||||
let material = ''
|
let material = ''
|
||||||
|
let arr = {
|
||||||
|
'7': 10,
|
||||||
|
'8': 3,
|
||||||
|
'9': 4,
|
||||||
|
'10': 4,
|
||||||
|
'11': 4,
|
||||||
|
'12': 2
|
||||||
|
}
|
||||||
|
if (entity) {
|
||||||
|
arr[type + ''] ? (entity.polyline.width = entity.polyline.oriWidth + arr[type + '']) : (entity.polyline.width = entity.polyline.oriWidth)
|
||||||
|
}
|
||||||
|
|
||||||
switch (Number(type)) {
|
switch (Number(type)) {
|
||||||
|
|
||||||
@ -616,22 +627,48 @@ class Tools {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 5: //普通流动虚线
|
case 5: //普通流动虚线
|
||||||
material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
// material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
||||||
color: color,
|
// color: color,
|
||||||
uType: 0,
|
// uType: 0,
|
||||||
speed: newParam.rotate ? newParam.speed : 0 - newParam.speed,
|
// speed: newParam.rotate ? newParam.speed : 0 - newParam.speed,
|
||||||
// dashSize: newParam.dashSize,
|
// // dashSize: newParam.dashSize,
|
||||||
space: newParam.space
|
// space: newParam.space,
|
||||||
})
|
// scale: 1.0
|
||||||
break
|
// })
|
||||||
|
// break
|
||||||
case 6: //流动虚线2
|
case 6: //流动虚线2
|
||||||
|
let that = this
|
||||||
|
|
||||||
material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
material = new Cesium.FlowDashedLineFlowMaterialProperty({
|
||||||
color: color,
|
color: color,
|
||||||
uType: 1,
|
uType: type == 5 ? 0 : 1,
|
||||||
speed: newParam.rotate ? newParam.speed : 0 - newParam.speed,
|
speed: newParam.rotate ? newParam.speed : 0 - newParam.speed,
|
||||||
// dashSize: newParam.dashSize,
|
// dashSize: newParam.dashSize,
|
||||||
space: newParam.space
|
space: newParam.space,
|
||||||
|
scale: new Cesium.CallbackProperty(function () {
|
||||||
|
var oriPositions = entity.polyline.positions.getValue();
|
||||||
|
|
||||||
|
if (!Cesium.defined(oriPositions)) {
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
var distance = 0;
|
||||||
|
for (var i = 0; i < oriPositions.length - 1; ++i) {
|
||||||
|
distance += Cesium.Cartesian3.distance(oriPositions[i], oriPositions[i + 1]);
|
||||||
|
}
|
||||||
|
//屏幕坐标
|
||||||
|
let point1 = new Cesium.Cartesian2(0, that.sdk.viewer.canvas.clientHeight)
|
||||||
|
let point2 = new Cesium.Cartesian2(that.sdk.viewer.canvas.clientWidth / 2, that.sdk.viewer.canvas.clientHeight)
|
||||||
|
var cartesian1 = that.sdk.viewer.scene.pickPosition(point1)
|
||||||
|
var cartesian2 = that.sdk.viewer.scene.pickPosition(point2)
|
||||||
|
|
||||||
|
var distance2 = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||||
|
|
||||||
|
let repeatX = distance2 * 2 / distance
|
||||||
|
|
||||||
|
return repeatX;
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
break
|
break
|
||||||
case 7: //流动箭头1
|
case 7: //流动箭头1
|
||||||
case 8: //流动箭头2
|
case 8: //流动箭头2
|
||||||
@ -645,17 +682,8 @@ class Tools {
|
|||||||
space: newParam.space,
|
space: newParam.space,
|
||||||
speed: newParam.speed
|
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
|
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)
|
this.getFlowTexture(this, param, entity)
|
||||||
|
|
||||||
@ -666,6 +694,7 @@ class Tools {
|
|||||||
}
|
}
|
||||||
return material
|
return material
|
||||||
}
|
}
|
||||||
|
|
||||||
getFlowTexture(that, options, entity) {
|
getFlowTexture(that, options, entity) {
|
||||||
|
|
||||||
const canvasEle = document.createElement('canvas');
|
const canvasEle = document.createElement('canvas');
|
||||||
@ -693,17 +722,15 @@ class Tools {
|
|||||||
|
|
||||||
// let repeat = getRepeat()
|
// let repeat = getRepeat()
|
||||||
// }, false)
|
// }, false)
|
||||||
entity.polyline.material.oriRepeat = undefined
|
// entity.polyline.material.oriRepeat = that.getSceenLine(entity, options, canvasEle)
|
||||||
entity.polyline.material.oriSpeed = undefined
|
// entity.polyline.material.oriSpeed = undefined
|
||||||
|
let beforeSpeed = 0, repeat = 0
|
||||||
entity.polyline.material = new Cesium.LineTextureMaterialProperty(
|
entity.polyline.material = new Cesium.LineTextureMaterialProperty(
|
||||||
{
|
{
|
||||||
color: options.color,
|
color: options.color,
|
||||||
// image: options.image,
|
|
||||||
image: canvasEle,
|
image: canvasEle,
|
||||||
speed: options.speed,
|
speed: options.speed,
|
||||||
// repeat: repeat
|
|
||||||
repeat: new Cesium.CallbackProperty(function () {
|
repeat: new Cesium.CallbackProperty(function () {
|
||||||
// function getRepeat() {
|
|
||||||
var positionProperty = entity.polyline.positions;
|
var positionProperty = entity.polyline.positions;
|
||||||
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
var positions = positionProperty.getValue(that.sdk.viewer.clock.currentTime);
|
||||||
|
|
||||||
@ -731,25 +758,64 @@ class Tools {
|
|||||||
|
|
||||||
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||||
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
var groundResolution = that.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||||
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
|
let result
|
||||||
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
if (groundResolution > 700) {
|
||||||
let speed
|
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||||
if (entity.polyline.material.oriRepeat) {
|
// if (entity.polyline.material.oriRepeat) {
|
||||||
speed = repeatX / entity.polyline.material.oriRepeat
|
let speed = repeatX / entity.polyline.oriRepeat
|
||||||
|
entity.polyline.oriSpeed = speed
|
||||||
|
entity.polyline.oriRepeatX = repeatX
|
||||||
|
// } else {
|
||||||
|
// entity.polyline.material.oriRepeat = repeatX
|
||||||
|
// }
|
||||||
|
beforeSpeed = speed
|
||||||
|
repeat = repeatX
|
||||||
|
result = new Cesium.Cartesian2(repeatX, speed || 1.0)
|
||||||
} else {
|
} else {
|
||||||
entity.polyline.material.oriRepeat = repeatX
|
result = new Cesium.Cartesian2(repeat || entity.polyline.oriRepeatX, beforeSpeed || entity.polyline.oriSpeed)
|
||||||
}
|
}
|
||||||
// if (repeatX < 3) {
|
|
||||||
// repeatX = 3
|
return result;
|
||||||
// }
|
|
||||||
return new Cesium.Cartesian2(repeatX, speed || 1.0);
|
|
||||||
// return repeatX;
|
// return repeatX;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
entity.polyline.material.oriSpeed = options.speed
|
let oriRepeat = that.getSceenLine(entity, options, canvasEle)
|
||||||
|
oriRepeat && (entity.polyline.oriRepeat = oriRepeat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**获取当前满屏横线速度 */
|
||||||
|
getSceenLine(entity, options, canvasEle) {
|
||||||
|
let point1 = new Cesium.Cartesian2(0, this.sdk.viewer.canvas.clientHeight)
|
||||||
|
let point2 = new Cesium.Cartesian2(this.sdk.viewer.canvas.clientWidth / 2, this.sdk.viewer.canvas.clientHeight)
|
||||||
|
var cartesian1 = this.sdk.viewer.scene.pickPosition(point1)
|
||||||
|
var cartesian2 = this.sdk.viewer.scene.pickPosition(point2)
|
||||||
|
|
||||||
|
var distance = Cesium.Cartesian3.distance(cartesian1, cartesian2);
|
||||||
|
|
||||||
|
var repeatX = distance / entity.polyline.width.getValue();
|
||||||
|
// 根据地图缩放程度调整repeatX
|
||||||
|
var cameraHeight = this.sdk.viewer.camera.positionCartographic.height;
|
||||||
|
var boundingSphere = new Cesium.BoundingSphere(
|
||||||
|
new Cesium.Cartesian3(-1000000, 0, 0), // 中心点坐标
|
||||||
|
500000 // 半径(距离)
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取绘图缓冲区的宽度和高度(通常是屏幕的分辨率)
|
||||||
|
var drawingBufferWidth = this.sdk.viewer.canvas.clientWidth;
|
||||||
|
var drawingBufferHeight = this.sdk.viewer.canvas.clientHeight;
|
||||||
|
|
||||||
|
// 使用 getPixelSize 方法获取包围球在屏幕上的像素大小
|
||||||
|
var groundResolution = this.sdk.viewer.scene.camera.getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight)
|
||||||
|
// repeatX *= groundResolution / cameraHeight / ((myImg.width / myImg.height * 5) + 1);
|
||||||
|
if (groundResolution > 700) {
|
||||||
|
repeatX *= groundResolution / cameraHeight / (options.space * (canvasEle.width / canvasEle.height * 5) + 1);
|
||||||
|
} else {
|
||||||
|
repeatX = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return repeatX
|
||||||
|
}
|
||||||
|
|
||||||
/*创建直箭头图片*/
|
/*创建直箭头图片*/
|
||||||
create_arrow1_picture(color) {
|
create_arrow1_picture(color) {
|
||||||
|
@ -1674,7 +1674,7 @@
|
|||||||
|
|
||||||
.YJ-custom-base-dialog>.content .cy_datalist dl dd.active {
|
.YJ-custom-base-dialog>.content .cy_datalist dl dd.active {
|
||||||
color: rgba(var(--color-sdk-base-rgb)) !important;
|
color: rgba(var(--color-sdk-base-rgb)) !important;
|
||||||
background-color: rgba(var(--color-sdk-base-rgb), 0.2);
|
/* background-color: rgba(var(--color-sdk-base-rgb), 0.2); */
|
||||||
}
|
}
|
||||||
|
|
||||||
.YJ-custom-base-dialog>.content .cy_datalist dl dd.active svg {
|
.YJ-custom-base-dialog>.content .cy_datalist dl dd.active svg {
|
||||||
@ -2714,6 +2714,122 @@
|
|||||||
max-height: 185px;
|
max-height: 185px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit-box textarea {
|
||||||
|
border-radius: unset!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit .datalist {
|
||||||
|
background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important;
|
||||||
|
border-radius: 4px 0px 0px 4px !important;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) .datalist {
|
||||||
|
background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important;
|
||||||
|
border-radius: 4px 0px, 0px, 4px!important;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) .datalist {
|
||||||
|
background-color:rgba(var(--color-sdk-base-rgb), 0.1)!important;
|
||||||
|
border-radius: 0px 4px 4px 0px!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(1) input {
|
||||||
|
border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-unit:nth-of-type(2) input {
|
||||||
|
border: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content input.input-text{
|
||||||
|
background-color: rgba(0, 0, 0, 0.5)!important;
|
||||||
|
border-radius: unset!important;
|
||||||
|
border-top: 1px solid rgba(var(--color-sdk-base-rgb), 0.5)!important;
|
||||||
|
border-bottom: 1px solid rgba(var(--color-sdk-base-rgb), 0.5) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist input {
|
||||||
|
padding-left: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .icon-active {
|
||||||
|
position: absolute;
|
||||||
|
top: 11px;
|
||||||
|
left: 10px;
|
||||||
|
-webkit-pointer-events: none;
|
||||||
|
-moz-pointer-events: none;
|
||||||
|
-ms-pointer-events: none;
|
||||||
|
-o-pointer-events: none;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.icon {
|
||||||
|
display: inline-block;
|
||||||
|
width: 22px;
|
||||||
|
height: 13px;
|
||||||
|
margin-right: 7px;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.line {
|
||||||
|
border: 1px solid rgba(var(--color-sdk-base-rgb), 1);
|
||||||
|
height: 0px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.dash-line {
|
||||||
|
border: 1px dashed rgba(var(--color-sdk-base-rgb), 1);
|
||||||
|
height: 0px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.light-line {
|
||||||
|
border: 1px solid rgba(var(--color-sdk-base-rgb), 1);
|
||||||
|
height: 0px;
|
||||||
|
margin-top: 4px;
|
||||||
|
box-shadow: 0 0 3px #fff
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.tail-line {
|
||||||
|
background: url(../../img/arrow/tail.png) 100% 100% no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.mult-tail-line {
|
||||||
|
background: url(../../img/arrow/tail.png) 100% 100% no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line1 {
|
||||||
|
border: 1px dashed rgba(var(--color-sdk-base-rgb), 1);
|
||||||
|
height: 0px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.flow-dash-line2 {
|
||||||
|
border: 1px dashed rgba(var(--color-sdk-base-rgb), 1);
|
||||||
|
height: 0px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line1 {
|
||||||
|
background: url(../../img/arrow/1.png);
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line2 {
|
||||||
|
background: url(../../img/arrow/2.png);
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line3 {
|
||||||
|
background: url(../../img/arrow/3.png);
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line4 {
|
||||||
|
background: url(../../img/arrow/4.png) ;
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line5 {
|
||||||
|
background: url(../../img/arrow/5.png);
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
|
.YJ-custom-base-dialog.polyline>.content>div .input-select-line-type-box .cy_datalist i.pic-line6 {
|
||||||
|
background: url(../../img/arrow/6.png) 100% 100% no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* 贴地图片 */
|
/* 贴地图片 */
|
||||||
.YJ-custom-base-dialog.ground-image>.content {
|
.YJ-custom-base-dialog.ground-image>.content {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.1 KiB |
BIN
static/img/arrow/222 (2).png
Normal file
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
BIN
static/img/arrow/333.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 5.2 KiB |
BIN
static/img/arrow/444.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 6.9 KiB |
BIN
static/img/arrow/555.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 3.4 KiB |
BIN
static/img/arrow/666.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
static/img/arrow/分组 79.png
Normal file
After Width: | Height: | Size: 356 B |