|
|
@ -458,11 +458,11 @@ export default { |
|
|
}, |
|
|
}, |
|
|
label: { |
|
|
label: { |
|
|
text: `WP${wpIndex}`, |
|
|
text: `WP${wpIndex}`, |
|
|
font: '12px MicroSoft YaHei', |
|
|
font: '14px Microsoft YaHei', |
|
|
pixelOffset: new Cesium.Cartesian2(0, -20), |
|
|
pixelOffset: new Cesium.Cartesian2(0, -20), |
|
|
fillColor: Cesium.Color.WHITE, |
|
|
fillColor: Cesium.Color.fromCssColorString('#333333'), |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineWidth: 2, |
|
|
outlineWidth: 1, |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -483,13 +483,8 @@ export default { |
|
|
if (positions.length > 0 && activeCursorPosition) return [...positions, activeCursorPosition]; |
|
|
if (positions.length > 0 && activeCursorPosition) return [...positions, activeCursorPosition]; |
|
|
return positions; |
|
|
return positions; |
|
|
}, false), |
|
|
}, false), |
|
|
width: 4, |
|
|
width: 3, |
|
|
// 黑白斑马材质 |
|
|
material: Cesium.Color.fromCssColorString('#800080'), |
|
|
material: new Cesium.PolylineDashMaterialProperty({ |
|
|
|
|
|
color: Cesium.Color.WHITE, // 主色:白 |
|
|
|
|
|
gapColor: Cesium.Color.BLACK, // 间隙色:黑 |
|
|
|
|
|
dashLength: 20.0 // 斑马纹长度 |
|
|
|
|
|
}), |
|
|
|
|
|
clampToGround: true |
|
|
clampToGround: true |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -562,7 +557,7 @@ export default { |
|
|
name: 'HOLD', |
|
|
name: 'HOLD', |
|
|
position: this.missionPendingHold.center, |
|
|
position: this.missionPendingHold.center, |
|
|
point: { pixelSize: 10, color: Cesium.Color.ORANGE, outlineColor: Cesium.Color.WHITE, outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY }, |
|
|
point: { pixelSize: 10, color: Cesium.Color.ORANGE, outlineColor: Cesium.Color.WHITE, outlineWidth: 2, disableDepthTestDistance: Number.POSITIVE_INFINITY }, |
|
|
label: { text: 'HOLD', font: '12px MicroSoft YaHei', fillColor: Cesium.Color.ORANGE, outlineColor: Cesium.Color.BLACK, outlineWidth: 2 } |
|
|
label: { text: 'HOLD', font: '14px Microsoft YaHei', fillColor: Cesium.Color.ORANGE, outlineColor: Cesium.Color.BLACK, outlineWidth: 1 } |
|
|
}); |
|
|
}); |
|
|
this.$emit('drawing-points-update', this.drawingPoints.length); |
|
|
this.$emit('drawing-points-update', this.drawingPoints.length); |
|
|
}, |
|
|
}, |
|
|
@ -933,7 +928,7 @@ export default { |
|
|
const lineColor = lineStyle.color || '#800080'; |
|
|
const lineColor = lineStyle.color || '#800080'; |
|
|
const gapColor = lineStyle.gapColor != null ? lineStyle.gapColor : '#000000'; |
|
|
const gapColor = lineStyle.gapColor != null ? lineStyle.gapColor : '#000000'; |
|
|
const dashLen = lineStyle.dashLength != null ? lineStyle.dashLength : 20; |
|
|
const dashLen = lineStyle.dashLength != null ? lineStyle.dashLength : 20; |
|
|
const useDash = (lineStyle.style || 'dash') === 'dash'; |
|
|
const useDash = (lineStyle.style || 'solid') === 'dash'; |
|
|
const lineMaterial = useDash |
|
|
const lineMaterial = useDash |
|
|
? new Cesium.PolylineDashMaterialProperty({ |
|
|
? new Cesium.PolylineDashMaterialProperty({ |
|
|
color: Cesium.Color.fromCssColorString(lineColor), |
|
|
color: Cesium.Color.fromCssColorString(lineColor), |
|
|
@ -986,11 +981,11 @@ export default { |
|
|
}, |
|
|
}, |
|
|
label: { |
|
|
label: { |
|
|
text: wp.name || `WP${index + 1}`, |
|
|
text: wp.name || `WP${index + 1}`, |
|
|
font: `${Math.max(9, pixelSize + 2)}px MicroSoft YaHei`, |
|
|
font: `${wp.labelFontSize != null ? Math.min(28, Math.max(10, Number(wp.labelFontSize))) : 14}px Microsoft YaHei`, |
|
|
pixelOffset: new Cesium.Cartesian2(0, -Math.max(14, pixelSize + 8)), |
|
|
pixelOffset: new Cesium.Cartesian2(0, -Math.max(14, pixelSize + 8)), |
|
|
fillColor: Cesium.Color.WHITE, |
|
|
fillColor: Cesium.Color.fromCssColorString(wp.labelColor || '#333333'), |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineWidth: 2, |
|
|
outlineWidth: 1, |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -1110,11 +1105,11 @@ export default { |
|
|
}, |
|
|
}, |
|
|
label: { |
|
|
label: { |
|
|
text: wpName, |
|
|
text: wpName, |
|
|
font: `${Math.max(9, pixelSize + 2)}px MicroSoft YaHei`, |
|
|
font: `${wp.labelFontSize != null ? Math.min(28, Math.max(10, Number(wp.labelFontSize))) : 14}px Microsoft YaHei`, |
|
|
pixelOffset: new Cesium.Cartesian2(0, -Math.max(14, pixelSize + 8)), |
|
|
pixelOffset: new Cesium.Cartesian2(0, -Math.max(14, pixelSize + 8)), |
|
|
fillColor: Cesium.Color.WHITE, |
|
|
fillColor: Cesium.Color.fromCssColorString(wp.labelColor || '#333333'), |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineColor: Cesium.Color.BLACK, |
|
|
outlineWidth: 2, |
|
|
outlineWidth: 1, |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
style: Cesium.LabelStyle.FILL_AND_OUTLINE |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -1626,12 +1621,21 @@ export default { |
|
|
imageryProvider: false, |
|
|
imageryProvider: false, |
|
|
terrainProvider: new Cesium.EllipsoidTerrainProvider(), |
|
|
terrainProvider: new Cesium.EllipsoidTerrainProvider(), |
|
|
baseLayer: false, |
|
|
baseLayer: false, |
|
|
// 允许截图时读取 canvas 内容(否则 toDataURL 会得到黑屏) |
|
|
// 按需渲染:仅在场景变化时渲染,降低空闲时 CPU/GPU 占用(若某处界面不刷新可主动调用 viewer.scene.requestRender()) |
|
|
|
|
|
requestRenderMode: true, |
|
|
|
|
|
maximumRenderTimeChange: Infinity, |
|
|
|
|
|
// 允许截图时读取 canvas 内容(若截图仅用 readPixels 可改为 false 以提升性能) |
|
|
contextOptions: { |
|
|
contextOptions: { |
|
|
preserveDrawingBuffer: true |
|
|
preserveDrawingBuffer: true |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.viewer.cesiumWidget.creditContainer.style.display = "none" |
|
|
this.viewer.cesiumWidget.creditContainer.style.display = "none" |
|
|
|
|
|
// 按需渲染时:实体增删改后主动请求一帧,避免界面不刷新 |
|
|
|
|
|
if (this.viewer.scene.requestRenderMode) { |
|
|
|
|
|
this.viewer.entities.collectionChanged.addEventListener(() => { |
|
|
|
|
|
this.viewer.scene.requestRender() |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
this.loadOfflineMap() |
|
|
this.loadOfflineMap() |
|
|
this.setup2DConstraints() |
|
|
this.setup2DConstraints() |
|
|
// 初始视野:中国中心(仅中国瓦片时无需世界瓦片,国外区域会无瓦片显示为空白) |
|
|
// 初始视野:中国中心(仅中国瓦片时无需世界瓦片,国外区域会无瓦片显示为空白) |
|
|
|