

addLoad() {
let pos1 = [
118.07187295999599,
36.94404904612924,
24.33621978350808,
118.07255297591854,
36.94397882628565,
24.317250291145577,
118.07313872136622,
36.94393280498323,
24.285724286655544,
118.07388008866477,
36.943889794954906,
24.275611045165753,
118.07461835990738,
36.943804448746285,
24.31308141680151,
118.07511761833722,
36.94377729205221,
24.3634941775598,
118.07589994063973,
36.94370840291612,
24.478692444024517,
118.07686513588554,
36.94363922585948,
24.324540626340994,
118.07770429875909,
36.94353567164247,
24.378282361258407,
118.07872230762662,
36.94345715426436,
24.56056228049799,
118.0794804613066,
36.9433765735383,
24.487728210193033,
118.08013131871887,
36.94333704981415,
24.477644610676105,
118.08017393408909,
36.94376786761706,
24.44591429286694,
118.08018813454125,
36.94429667044136,
24.31700847052678,
118.08022651177846,
36.94487106450389,
24.185985390459066,
118.08018999005853,
36.94537889273716,
24.07649086916988,
118.0801626054073,
36.94578720973594,
24.01327148222909,
118.08018385937811,
36.94638289595944,
24.91015111760378,
118.08024545676929,
36.94697441789053,
24.820048955388383,
118.08024208106417,
36.94760882984712,
24.740837454586618,
118.08015246133999,
36.947913936316624,
24.730905975351167,
118.07962599457676,
36.94791634204142,
24.569177518618297,
118.07915444367787,
36.94791421085646,
24.433943930028526,
118.0786621438234,
36.94793347427117,
24.430709555675087,
118.07777628957948,
36.947894325484704,
33.46460538454509,
118.07713441750222,
36.94793824449395,
24.487543677792523,
118.07654883124802,
36.94794630065163,
24.444630844315114,
118.07585978596784,
36.947959883437136,
24.449561581046172,
118.07511385087616,
36.947954918513645,
24.290981153046577,
118.07454164571489,
36.947958835305805,
24.25097381437232,
118.07406952618899,
36.9479538652957,
24.322919423343492,
118.07331394435478,
36.9479576813552,
24.416750452286717,
118.07264086591735,
36.94798458963384,
24.600947847742507,
118.07199536591351,
36.947954153155585,
24.785922335258437,
118.07198420901216,
36.94747147788645,
24.79493328494028,
118.07192395744428,
36.946842804334075,
24.88431264587084,
118.07191473603741,
36.946300015270495,
24.816451682228173,
118.07191364874913,
36.9457054810611,
24.015195702606096,
118.0718379218424,
36.94514047624753,
24.1493919980008,
118.07186168202536,
36.944544567409835,
24.303439719606857,
118.07183801697177,
36.94419755567717,
24.334249784539768,
];
viewer_g.entities.add({
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(pos1),
width: 40.0,
material: new Cesium.PolylineTrailMaterialProperty({
period: 10.0,
// constantSpeed:5.0,
color: Cesium.Color.DARKORANGE,
trailLength: 0.3,
}),
},
});
function PolylineTrailLinkMaterialProperty(color, duration) {
this._definitionChanged = new Cesium.Event();
this._color = undefined;
this._colorSubscription = undefined;
this.color = color;
this.duration = duration;
this._time = new Date().getTime();
}
Object.defineProperties(PolylineTrailLinkMaterialProperty.prototype, {
isConstant: {
get: function () {
return false;
},
},
definitionChanged: {
get: function () {
return this._definitionChanged;
},
},
color: Cesium.createPropertyDescriptor("color"),
});
PolylineTrailLinkMaterialProperty.prototype.getType = function (time) {
return "PolylineTrailLink2";
};
PolylineTrailLinkMaterialProperty.prototype.getValue = function (
time,
result
) {
if (!Cesium.defined(result)) {
result = {};
}
result.color = Cesium.Property.getValueOrClonedDefault(
this._color,
time,
Cesium.Color.WHITE,
result.color
);
result.image = Cesium.Material.PolylineTrailLinkImage;
result.time =
((new Date().getTime() - this._time) % this.duration) / this.duration;
return result;
};
PolylineTrailLinkMaterialProperty.prototype.equals = function (other) {
return (
this === other ||
(other instanceof PolylineTrailLinkMaterialProperty &&
Property.equals(this._color, other._color))
);
};
Cesium.PolylineTrailLinkMaterialProperty = PolylineTrailLinkMaterialProperty;
Cesium.Material.PolylineTrailLinkType = "PolylineTrailLink2";
Cesium.Material.PolylineTrailLinkImage = "/public/image/colors1.png";
Cesium.Material.PolylineTrailLinkSource =
"czm_material czm_getMaterial(czm_materialInput materialInput)\n\
{\n\
czm_material material = czm_getDefaultMaterial(materialInput);\n\
vec2 st = materialInput.st*40.0;\n\
vec4 colorImage = texture2D(image, vec2(fract(st.s - time*40.0), fract(st.t)));\n\
material.alpha = colorImage.a * color.a;\n\
material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\
return material;\n\
}";
Cesium.Material._materialCache.addMaterial(
Cesium.Material.PolylineTrailLinkType,
{
fabric: {
type: Cesium.Material.PolylineTrailLinkType,
uniforms: {
color: new Cesium.Color(1.0, 0.0, 0.0, 0.5),
image: Cesium.Material.PolylineTrailLinkImage,
time: 0,
},
source: Cesium.Material.PolylineTrailLinkSource,
},
translucent: function (material) {
return true;
},
}
);
viewer_g.entities.add({
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights(pos1),
width: 5.0,
material: new Cesium.PolylineTrailLinkMaterialProperty(
Cesium.Color.RED,
10000
),
},
});
},
网友评论