PolylineDashMaterialProperty breaks Datasources Hierarchy ( 2D view)
- Dominant language
- JavaScript
- Stars
- 15.7k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
The bug occurs when we add to a polyline inside a Datasource a 'material' property of type Cesium.PolylineDashMaterialProperty. When adding the property the polyline drawn ignores the DatasourceCollection Hierarchy and goes below all entities.
The required view to reproducing the bug is 2D.
The following code creates two Datasources, one that contains cesium Entity with polyline and 0 that contains cesium Entity with a billboard.
[First example, works as expected, polyline above the billboard.](https://sandcastle.cesium.com/#c=jVNdb5swFP0rV7xAJGZEu2gSpdG0TNpLpT202suoKoMdYs34In8QpVP/+wyUNiSNMp7uPT7n+H6YjmroBN9xDbeg+A7W3AjXkF8DFhVBNeRrVJYKxXURLG4K1XkVo5beo9MVT+fStTMWm+9vx1FosX1Pw1ODq0sGJdoZMngU6sCBcGWFFdwQylj0t1AwfIo2PIPwh+Zcgd66pgTp2wjjidCi3PdIBm+aV9x4O1Qmg99TWVRbH1F1TTbaV8Nr72qiT1+WMVwvFzFc4KVXI/Exnt20E8xuM0jJcoJfCvVy3GB6psGpzgz+s8pJWAopS6SaHXcuGlr3MyMkGUKTjM5Pd1jjE3ZcS7onrarDGJIEGN9QJ20GTvnQT5LN3MwWdxlY7fghe06pqPQXfj5tf3yY5H0KY/MHax/e0iVWeoYl0SMP+G14XGdcnxGbB4xes2kHi5sgDnJj95KvprK/iqZFbcFpGfnZWd60kvpVJKWr/nBLKmN6356aJ4fSnIkOBLv94F+DSlJj/MnGSXkvnnkRrPLE80+kEikTqv45rqenbdPV3QgSQvLEpx8rLaIsqT5y/gc)
Note that the line "viewer.dataSources.lowerToBottom(dataSource1);" will make the drawn polyline go above the billboard.
[Second example, bug reproduced, polyline goes under billboard regardless of Datasources Hierarchy.](https://sandcastle.cesium.com/#c=jVNRb9owEP4rJ14IUuY07apJKUXTqLQXplVq1Zdlqpz4CNYcX2Q7IDrx32cSQgkUMT/5Pn/33fnzeckNLCWu0MA9aFzBFK2sS/bSYEE6yJt4StpxqdGkg9Fdqpc+S3DHn6g2Ocb91GltHZUP++Ng6Kh6D4enAteXBDJyPaTRSPWBAkPtpJNoGRci+JtqaJbmJSYw/G4QNZhFXWag/DWGYUeoSK23SAL7nB1uvRxpm8Cvri1unN9xfcPmxneDhVe1wacvtyHc3I5CuMCLr1vi77BXqeQOjeQqObTgcdfWA7eLHzvCo6EKjVsH/U73S3juDHXhFgnEV+yqx9qM+lVXUjQ8dtvBm1Rvjm2Nz9jauZPAf3rTJWZSqYy4Ecd+y5IX25diLGq2NmqVX2dU0Cst0Si+ZpUuhiFEEQic81q5BGrtt94o0VOzC1ol4EyNh+w+JefKF/x8ev32O7B3F9rLHwxbM8GXWPEZliKPPNO3ZqTPqL4Rlc8U7KLuDUZ3g3Awtm6tcNK1/VWWFRkHtVGB985hWSk/LzbK6vwPOpZbu9XdUsfRYepYyCVIcf/BD4dccWv9ybxW6km+YTqYjCPPP0lVxIXUxc/2eba0RTyZtSBjbBz58ONMR6Qybo6U/wE)
I first encountered this behavior in a standalone project which I cant share its code.
What happened in that project was the exact opposite, the polyline was always above all Datasources entities when adding the property! regardless of hierarchy!
Unfortunately, I failed to reproduce the opposite bug.
Cesium view: 2D
Browser: Chrome
Operating System: Windows
Contributor guide
Research direction
Start with the two linked Sandcastle examples and reproduce the behavior in 2D using DatasourceCollection hierarchy operations, comparing a plain polyline with one using Cesium.PolylineDashMaterialProperty. Trace how the dashed polyline is rendered relative to billboard entities and verify that lowerToBottom produces the expected ordering. Done means datasource hierarchy is respected consistently for the dashed polyline in 2D.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100