feat: 修改弧线动态分段数

This commit is contained in:
2912401452 2021-09-02 11:59:12 +08:00
parent 90b1e3a087
commit 3e05aeae71
4 changed files with 9 additions and 5 deletions

View File

@ -33,6 +33,7 @@ export default class ArcModel extends BaseModel {
forward = true, forward = true,
lineTexture = false, lineTexture = false,
iconStep = 100, iconStep = 100,
segmentNumber = 30,
} = this.layer.getLayerConfig() as ILineLayerStyleOptions; } = this.layer.getLayerConfig() as ILineLayerStyleOptions;
if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) { if (this.dataTextureTest && this.dataTextureNeedUpdate({ opacity })) {
@ -89,7 +90,7 @@ export default class ArcModel extends BaseModel {
u_opacity: isNumber(opacity) ? opacity : 1.0, u_opacity: isNumber(opacity) ? opacity : 1.0,
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
segmentNumber: 30, segmentNumber,
u_line_type: lineStyleObj[lineType || 'solid'], u_line_type: lineStyleObj[lineType || 'solid'],
u_dash_array: dashArray, u_dash_array: dashArray,
u_blur: 0.9, u_blur: 0.9,

View File

@ -31,6 +31,7 @@ export default class Arc3DModel extends BaseModel {
dashArray = [10, 5], dashArray = [10, 5],
lineTexture = false, lineTexture = false,
iconStep = 100, iconStep = 100,
segmentNumber = 30,
} = this.layer.getLayerConfig() as ILineLayerStyleOptions; } = this.layer.getLayerConfig() as ILineLayerStyleOptions;
if (dashArray.length === 2) { if (dashArray.length === 2) {
@ -87,7 +88,7 @@ export default class Arc3DModel extends BaseModel {
// u_opacity: opacity === undefined ? 1 : opacity, // u_opacity: opacity === undefined ? 1 : opacity,
u_opacity: isNumber(opacity) ? opacity : 1.0, u_opacity: isNumber(opacity) ? opacity : 1.0,
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
segmentNumber: 30, segmentNumber,
u_line_type: lineStyleObj[lineType as string] || 0.0, u_line_type: lineStyleObj[lineType as string] || 0.0,
u_dash_array: dashArray, u_dash_array: dashArray,

View File

@ -34,6 +34,7 @@ export default class GreatCircleModel extends BaseModel {
dashArray = [10, 5], dashArray = [10, 5],
lineTexture = false, lineTexture = false,
iconStep = 100, iconStep = 100,
segmentNumber = 30,
} = this.layer.getLayerConfig() as Partial<ILineLayerStyleOptions>; } = this.layer.getLayerConfig() as Partial<ILineLayerStyleOptions>;
// console.log('opacity', opacity) // console.log('opacity', opacity)
if (dashArray.length === 2) { if (dashArray.length === 2) {
@ -90,7 +91,7 @@ export default class GreatCircleModel extends BaseModel {
// u_opacity: opacity === undefined ? 1 : opacity, // u_opacity: opacity === undefined ? 1 : opacity,
u_opacity: isNumber(opacity) ? opacity : 1.0, u_opacity: isNumber(opacity) ? opacity : 1.0,
u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0, u_textureBlend: textureBlend === 'normal' ? 0.0 : 1.0,
segmentNumber: 30, segmentNumber,
u_line_type: lineStyleObj[lineType as string] || 0.0, u_line_type: lineStyleObj[lineType as string] || 0.0,
u_dash_array: dashArray, u_dash_array: dashArray,

View File

@ -44,8 +44,9 @@ export default class Amap2demo_arcLine extends React.Component {
.style({ .style({
opacity: 0.8, opacity: 0.8,
blur: 0.99, blur: 0.99,
lineType: 'dash', segmentNumber: 30
dashArray: [5, 5], // lineType: 'dash',
// dashArray: [5, 5],
}); });
// .forward(false) // .forward(false)
scene.addLayer(layer); scene.addLayer(layer);