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

Modify Rectangle.fromCartographicArray to support rectangles that cross the IDL #3322

Merged
merged 3 commits into from
Dec 10, 2015

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Dec 9, 2015

Fixes #3227

@hpinkos
Copy link
Contributor Author

hpinkos commented Dec 9, 2015

Here's the sandcastle example I was testing with:

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

var cartos = [Cesium.Cartographic.fromDegrees(-179, -4),
              Cesium.Cartographic.fromDegrees(1, 4)];
var points = viewer.scene.globe.ellipsoid.cartographicArrayToCartesianArray(cartos);

for (var i = 0; i < points.length; i++) {
    viewer.entities.add({
        position : points[i],
        point : {
            pixelSize : 10,
            color : Cesium.Color.YELLOW
        }
    });
}

var rectangle = Cesium.Rectangle.fromCartographicArray(cartos);
var redRectangle = viewer.entities.add({
    rectangle : {
        coordinates : rectangle,
        material : Cesium.Color.RED.withAlpha(0.5),
        outline : true,
        outlineColor : Cesium.Color.RED
    }
});

viewer.entities.add({
    polyline: {
        positions: Cesium.Cartesian3.fromDegreesArray([180, -80, 180, 80])
    }
});

@pjcozzi
Copy link
Contributor

pjcozzi commented Dec 9, 2015

Thanks @hpinkos! Update CHANGES.md.

@bagnell can you review this one too?

bagnell added a commit that referenced this pull request Dec 10, 2015
…ayIDL

Modify Rectangle.fromCartographicArray to support rectangles that cross the IDL
@bagnell bagnell merged commit 87bb36a into master Dec 10, 2015
@bagnell bagnell deleted the rectangleCartoArrayIDL branch December 10, 2015 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants