Fix GeometryInstance JSDoc to correctly document GeometryFactory usage#13411
Open
gy1016 wants to merge 2 commits intoCesiumGS:mainfrom
Open
Fix GeometryInstance JSDoc to correctly document GeometryFactory usage#13411gy1016 wants to merge 2 commits intoCesiumGS:mainfrom
gy1016 wants to merge 2 commits intoCesiumGS:mainfrom
Conversation
Fixes CesiumGS#13361 When a label has empty text, Label.getScreenSpaceBoundingBox previously returned Infinity/-Infinity values (since the glyph loop did not execute, leaving x=Infinity, maxX=0), which corrupted the bounding rectangle calculations in the clustering algorithm and caused all clustering to break. Changes: - Label.getScreenSpaceBoundingBox now returns a zero-size bounding box at the screen position for empty text labels, instead of garbage Infinity values - EntityCluster.getScreenSpacePositions skips labels with empty text since they have no visual content to cluster - EntityCluster.getBoundingBox skips the label bounding box union for associated labels with empty text - Added tests for both the Label and EntityCluster changes
Fixes CesiumGS#12826 The previous documentation incorrectly stated that options.geometry could be either a Geometry or GeometryFactory. However, passing an already-constructed Geometry object causes the error: 'DeveloperError: Must define either _workerName or _workerPath for asynchronous geometry' This fix: - Changes @param type from 'Geometry|GeometryFactory' to 'GeometryFactory' - Adds explanation that users should pass a GeometryFactory (like BoxGeometry, RectangleOutlineGeometry) and NOT the result of createGeometry() - Changes the internal @type from 'Geometry' to 'GeometryFactory'
Contributor
|
Thank you for the pull request, @gy1016! Welcome to the Cesium community! In order for us to review your PR, please complete the following steps:
Review Pull Request Guidelines to make sure your PR gets accepted quickly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12826
Problem
The previous documentation incorrectly stated that options.geometry could be either a Geometry or GeometryFactory. However, passing an already-constructed Geometry object (the result of calling createGeometry()) causes the error:
DeveloperError: Must define either _workerName or _workerPath for asynchronous geometryThis is confusing for users who read the docs but don't realize they're supposed to pass a factory (like BoxGeometry.fromDimensions()), not a ready-made geometry.
Fix
Checklist