Uncaught DeveloperError: Expected Year to be greater than or equal to 1 - when zooming out timeline
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 15.8k
- Forks
- 3.9k
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 34
Description
### What happened?
If you use the mouse wheel to zoom out a long way on the timeline (past when other centuries are visible), eventually the following error is produced:
Uncaught DeveloperError: Expected Year to be greater than or equal to 1, actual value was -160
Error
at new DeveloperError (https://sandcastle.cesium.com/js/engine/index.js:12353:11)
at Check.typeOf.number.greaterThanOrEquals (https://sandcastle.cesium.com/js/engine/index.js:12440:11)
at validateRange (https://sandcastle.cesium.com/js/engine/index.js:16789:33)
at GregorianDate (https://sandcastle.cesium.com/js/engine/index.js:16771:3)
at _JulianDate.toGregorianDate (https://sandcastle.cesium.com/js/engine/index.js:17377:14)
at Timeline._makeTics (https://sandcastle.cesium.com/js/widgets/index.js:11200:37)
at Timeline.zoomTo (https://sandcastle.cesium.com/js/widgets/index.js:11104:8)
at Timeline.zoomFrom (https://sandcastle.cesium.com/js/widgets/index.js:11125:8)
at HTMLDivElement. (https://sandcastle.cesium.com/js/widgets/index.js:11509:14) (on line 12440 of https://sandcastle.cesium.com/js/engine/index.js)
And it doesn't appear to be recoverable.
### Reproduction steps
1. Load any Sandcastle
2. Put cursor over timeline
3. Use mouse wheel to zoom out - keep going until you get the error (which is around when you can see other centuries)
### Sandcastle example
Any
### Environment
Browser: Edge
CesiumJS Version: 1.145.0
Operating System: Windows
### AI acknowledgment
- [ ] I used AI to generate this issue report.
- [ ] (If the above is checked) I have reviewed the AI-generated content before submitting.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by zooming out repeatedly over the timeline in any Sandcastle. Start at Timeline.zoomFrom and Timeline.zoomTo, then inspect Timeline._makeTics and its call to JulianDate.toGregorianDate, which reaches GregorianDate validation. Done means zooming out past other centuries no longer throws the reported negative-year error and the timeline remains usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100