1. A concise explanation of the problem you’re experiencing.
I would like to have a trailing orange path behind movement of my billboard entity. I am programmatically controlling its movement (it is coming from a live remote sensor). The the actual SVG/Canvas for the symbol comes from: https://github.com/spatialillusions/milsymbol
But the point is that I am clearly making an error in how to setup the PATH attribute of the entity. I don’t see a trailing or leading path. What am I doing wrong?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
makeGlyph(sprite) {
let milSym = milSymbols[sprite.type]
if (milSym === undefined) milSym = milSymbols[“UFO”]
sprite.mps = 0
sprite.symbol = milSym
let sym2 = new ms.Symbol(milSym, { size: 26, type: sprite.marking, speed: sprite.mps + ’ mps’, direction: sprite.heading, infoColor: “red” })
let glyph = new Cesium.Entity({
name: sprite.marking,
id: sprite.id,
position: Cesium.Cartesian3.fromDegrees(sprite.lon, sprite.lat, sprite.altitude),
billboard: {
image: sym2.asCanvas(), //Get the canvas for the billboard
// heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
pixelOffset: new Cesium.Cartesian2(-sym2.markerAnchor.x, -sym2.markerAnchor.y), // Symbol offset
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, 0.0), // default
horizontalOrigin: Cesium.HorizontalOrigin.LEFT, // default
verticalOrigin: Cesium.VerticalOrigin.TOP
},
path: {
leadTime: 100,
trailTime: 100,
width: 1,
material: new Cesium.ColorMaterialProperty({
color : Cesium.Color.ORANGE,
})
},
label: {
text: sprite.marking,
font: ‘14pt monospace’,
style: Cesium.LabelStyle.FILL_AND_OUTLINE,
outlineWidth: 1,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(0, -20)
}
})
sprite.glyph = glyph
this.infoBox(sprite)
this.viewer.entities.add(glyph)
}
updateGlyph(sprite) {
this.viewer.entities.suspendEvents()
let loc = Cesium.Cartesian3.fromDegrees(sprite.lon, sprite.lat, sprite.altitude)
sprite.mps = sprite.speed[0] + sprite.speed[1] + sprite.speed[2]
sprite.glyph.position = loc;
this.infoBox(sprite)
this.viewer.entities.resumeEvents()
}
killGlyph(sprite) {
this.viewer.entities.removeById(sprite.id)
}
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
We are tracking live aircraft and pedestrians, and we are showing the current map position with a billboard. But we would like to see a trailing path of where they have traveled for the last N seconds. We thought that Entity.path was the correct attribute to set on creation.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.39, Chrome 61