|
|
@ -104,6 +104,7 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
defaultHeight: 50000, |
|
|
|
defaultLineWidth: 6, |
|
|
|
isFullScreen: false, |
|
|
|
long: '', |
|
|
|
lat: '', |
|
|
@ -161,17 +162,18 @@ export default { |
|
|
|
layer = new sycim.EntityLayer('layer'); |
|
|
|
viewer.addLayer(layer); |
|
|
|
plot = new sycim.Plot(viewer); |
|
|
|
viewer.on( |
|
|
|
sycim.SceneEventType.CAMERA_CHANGED, |
|
|
|
() => { |
|
|
|
viewer.setOptions({ |
|
|
|
globe: { |
|
|
|
depthTestAgainstTerrain: viewer.cameraPosition.alt > 10000 ? false : true |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
viewer |
|
|
|
); |
|
|
|
// 三维模型才需要 |
|
|
|
// viewer.on( |
|
|
|
// sycim.SceneEventType.CAMERA_CHANGED, |
|
|
|
// () => { |
|
|
|
// viewer.setOptions({ |
|
|
|
// globe: { |
|
|
|
// depthTestAgainstTerrain: viewer.cameraPosition.alt > 10000 ? false : true |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// viewer |
|
|
|
// ); |
|
|
|
setTimeout(() => { |
|
|
|
viewer.scene.camera.setView({ |
|
|
|
destination: new Cesium.Cartesian3.fromDegrees(113.27, 23.13, this.defaultHeight), |
|
|
@ -250,21 +252,13 @@ export default { |
|
|
|
graphicItem = new sycim.Polyline(item.positions); |
|
|
|
graphicItem.setStyle({ |
|
|
|
canEdit: this.canEdit, |
|
|
|
width: 16, |
|
|
|
width: this.defaultLineWidth, |
|
|
|
clampToGround: true, |
|
|
|
lineType: '1', |
|
|
|
speed_s: 2, |
|
|
|
horizontalOrigin: sycim.HorizontalOrigin.CENTER, |
|
|
|
verticalOrigin: sycim.VerticalOrigin.BOTTOM, |
|
|
|
|
|
|
|
material: new sycim.PolylineImageTrailMaterialProperty({ |
|
|
|
speed: 2, |
|
|
|
image: `/icons/${item.icon}`, |
|
|
|
repeat: { |
|
|
|
x: 50, |
|
|
|
y: 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
material: sycim.Cesium.Color.fromCssColorString('#36B29E') |
|
|
|
}) |
|
|
|
} |
|
|
|
if(graphicItem){ |
|
|
@ -292,11 +286,12 @@ export default { |
|
|
|
let plotOptions = { |
|
|
|
scale: 1, |
|
|
|
image: `/icons/${iconName}`, |
|
|
|
material: sycim.Cesium.Color.fromCssColorString('#36B29E'), |
|
|
|
horizontalOrigin: sycim.HorizontalOrigin.CENTER, |
|
|
|
verticalOrigin: sycim.VerticalOrigin.BOTTOM, |
|
|
|
} |
|
|
|
if(type === 'polyline'){ |
|
|
|
plotOptions.width = 16 |
|
|
|
plotOptions.width = 4 |
|
|
|
} |
|
|
|
if(plot) plot.stop() |
|
|
|
plot.draw( |
|
|
@ -310,25 +305,19 @@ export default { |
|
|
|
canEdit: true, |
|
|
|
horizontalOrigin: sycim.HorizontalOrigin.CENTER, |
|
|
|
verticalOrigin: sycim.VerticalOrigin.BOTTOM, |
|
|
|
//disableDepthTestDistance: 5000, |
|
|
|
}) |
|
|
|
}else if(type === 'polyline'){ |
|
|
|
graphicItem = new sycim.Polyline(graphic.positions); |
|
|
|
graphicItem.setStyle({ |
|
|
|
canEdit: true, |
|
|
|
width: 16, |
|
|
|
width: this.defaultLineWidth, |
|
|
|
clampToGround: true, |
|
|
|
lineType: '1', |
|
|
|
speed_s: 2, |
|
|
|
horizontalOrigin: sycim.HorizontalOrigin.CENTER, |
|
|
|
verticalOrigin: sycim.VerticalOrigin.BOTTOM, |
|
|
|
material: new sycim.PolylineImageTrailMaterialProperty({ |
|
|
|
speed: 2, |
|
|
|
image: `/icons/${iconName}`, |
|
|
|
repeat: { |
|
|
|
x: 50, |
|
|
|
y: 1 |
|
|
|
} |
|
|
|
}) |
|
|
|
material: sycim.Cesium.Color.fromCssColorString('#36B29E') |
|
|
|
}) |
|
|
|
} |
|
|
|
if(graphicItem){ |
|
|
|