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

Fix polygons using rhumb lines across IDL #7520

Merged
merged 1 commit into from Jan 29, 2019

Conversation

shehzan10
Copy link
Member

Polygons with rhumb lines weren't being correctly rendered across the IDL because of subdivision. This has now been fixed.

Doesn't affect Polylines, PolygonOutlineGeometry etc.

I added a spec for the IDL test case. The change in computation also required updating the existing spec for the function.

Sandcastle to test:

var viewer = new Cesium.Viewer('cesiumContainer');

var purplePolygonUsingRhumbLines = viewer.entities.add({
    name : 'Purple polygon using rhumb lines with outline',
    polygon : {
        hierarchy : Cesium.Cartesian3.fromDegreesArray([-170.0, 45.0,
                                                        170.0, 45.0,
                                                        170.0, 55.0,
                                                        -170.0, 55.0]),
        extrudedHeight: 50000,
        material : Cesium.Color.PURPLE,
        outline : true,
        outlineColor : Cesium.Color.MAGENTA,
        arcType : Cesium.ArcType.RHUMB
    }
});

var degrees = [
    170, 50,
   -170, 50,
   -170, 40,
    175, 40,
    175, 30,
   -170, 30,
   -170, 20,
    170, 20
];

viewer.entities.add({
    name : 'rhumb',
    polygon : {
        hierarchy : Cesium.Cartesian3.fromDegreesArray(degrees),
        arcType : Cesium.ArcType.RHUMB,
        material : Cesium.Color.BLUE.withAlpha(0.5),
        height: 0
    }
});

viewer.zoomTo(viewer.entities);

@likangning93 Can you review? Thanks for letting me know of this.

@cesium-concierge
Copy link

cesium-concierge commented Jan 29, 2019

Thanks for the pull request @shehzan10!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@likangning93
Copy link
Contributor

Thanks @shehzan10!

@likangning93 likangning93 merged commit 1f780d1 into CesiumGS:master Jan 29, 2019
@shehzan10 shehzan10 deleted the fix-rhumb-polygons-idl branch February 7, 2019 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants