Modify the default material.

This commit is contained in:
ethan 2024-03-23 20:30:27 +08:00
parent 6d45edd800
commit d7ee304f48
3 changed files with 10 additions and 10 deletions

View File

@ -49,8 +49,8 @@ export default class CurvedArrow extends Base {
const distance = Utils.MathDistance(pnt1, pnt2);
let len = distance / this.arrowLengthScale;
len = len > this.maxArrowLength ? this.maxArrowLength : len;
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, true);
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, true);
const points = [...pnt1, ...pnt2, ...leftPnt, ...pnt2, ...rightPnt];
const cartesianPoints = this.cesium.Cartesian3.fromDegreesArray(points);
return cartesianPoints;
@ -86,8 +86,8 @@ export default class CurvedArrow extends Base {
const distance = Utils.wholeDistance(lnglatPoints);
let len = distance / this.arrowLengthScale;
len = len > this.maxArrowLength ? this.maxArrowLength : len;
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, true);
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, true);
const temp = [].concat(...curvePoints);
const points = [...temp, ...leftPnt, ...pnt2, ...rightPnt];
const cartesianPoints = this.cesium.Cartesian3.fromDegreesArray(points);

View File

@ -65,8 +65,8 @@ export default class StraightArrow extends Base {
const distance = Utils.MathDistance(pnt1, pnt2);
let len = distance / this.arrowLengthScale;
len = len > this.maxArrowLength ? this.maxArrowLength : len;
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 3, true);
const leftPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, false);
const rightPnt = Utils.getThirdPoint(pnt1, pnt2, Math.PI / 6, len / 2, true);
const points = [...pnt1, ...pnt2, ...leftPnt, ...pnt2, ...rightPnt];
const cartesianPoints = this.cesium.Cartesian3.fromDegreesArray(points);
return cartesianPoints;

View File

@ -57,8 +57,8 @@ export default class Base {
if (this.type === 'polygon') {
this.style = Object.assign(
{
material: this.cesium.Color.fromCssColorString('rgba(59, 178, 208, 0.2)'),
outlineMaterial: this.cesium.Color.fromCssColorString('rgba(59, 178, 208, 1.0)'),
material: new this.cesium.Color(),
outlineMaterial: new this.cesium.Color(),
outlineWidth: 2,
},
style,
@ -66,7 +66,7 @@ export default class Base {
} else if (this.type === 'line') {
this.style = Object.assign(
{
material: this.cesium.Color.fromCssColorString('rgba(59, 178, 208, 1.0)'),
material: new this.cesium.Color(),
lineWidth: 2,
},
style,