Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroundPolylineGeometry should detect when only one unique point given. #6702

Closed
OmarShehata opened this issue Jun 19, 2018 · 1 comment
Closed

Comments

@OmarShehata
Copy link
Contributor

@likangning93 currently, the following code crashes with the following error.

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.entities.add({
    polyline : {
        positions : [new Cesium.Cartesian3(1,1,1),new Cesium.Cartesian3(1,1,1)],
        clampToGround : true,
        width : 3
    }
});
An error occurred while rendering.  Rendering has stopped.
undefined
DeveloperError: normalized result is not a number
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:43:19)
    at Function.Cartesian3.normalize (http://localhost:8080/Source/Core/Cartesian3.js:421:19)
    at direction (http://localhost:8080/Source/Core/GroundPolylineGeometry.js:334:20)
    at computeRightNormal (http://localhost:8080/Source/Core/GroundPolylineGeometry.js:188:23)
    at Function.GroundPolylineGeometry.createGeometry (http://localhost:8080/Source/Core/GroundPolylineGeometry.js:489:28)
    at http://localhost:8080/Source/Workers/createGroundPolylineGeometry.js:17:47
    at Promise.then (http://localhost:8080/Source/ThirdParty/when.js:196:34)
    at http://localhost:8080/Source/ThirdParty/when.js:297:13
    at processQueue (http://localhost:8080/Source/ThirdParty/when.js:647:4)
    at _resolve (http://localhost:8080/Source/ThirdParty/when.js:333:4)

This is because, given two duplicate points, GroundPolylineGeometry will remove the duplicate, but it still assumes there will be at least 2 points. I think it should detect when that happens and not draw anything (see discussion here #6693 (comment) )

@likangning93
Copy link
Contributor

Thanks for the heads up @OmarShehata!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants