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 entities when geometry show interval is out of range #7458

Merged
merged 1 commit into from
Jan 3, 2019

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Jan 3, 2019

Fixes #2650

If the show interval is undefined for part of the availability, it now hides the geometry instead of crashing.

var czml = [{
        "id": "document",
        "version": "1.0"
}, {
    "id": "water1First",
    "availability": "2012-08-04T00:00:00Z/2012-08-05T02:00:54.9962195740191Z",
    "polygon": {
        "positions": {
            "cartographicDegrees": [
                0, 0, 55660,
                0.5, 0, 55660,
                0.5, 5, 55660,
                0, 5, 55660,
                0, 0, 55660
            ]
        },
        "material": {
            "solidColor": {
                "color": {
                    "rgba": [0, 0, 255, 255]
                }
            }
        },
        "outline": [
            {
                "boolean": true
            }
        ],
        "perPositionHeight": [
            {
                "boolean": true
            }
        ],
        "show": [
            {
                "interval": "2012-08-04T00:00:00Z/2012-08-04T02:00:54.9962195740191Z",
                "boolean": true
            }
        ]
    }
}];

var viewer = new Cesium.Viewer('cesiumContainer');
var dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);

@cesium-concierge
Copy link

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

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

I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@hpinkos hpinkos requested a review from mramato January 3, 2019 15:31
@mramato
Copy link
Contributor

mramato commented Jan 3, 2019

Does it make more sense to default to false? Since not defining show defaults to true does that make more sense? I don't know the answer, just trying to reason my way to one and wondering what you were thinking?

@hpinkos
Copy link
Contributor Author

hpinkos commented Jan 3, 2019

My thinking is if show is undefined, the behavior is whatever we decide we want it to be, and undefined is usually false. But I guess since we normally default show to true that could make sense too. We chose to default color to white in this similar situation.

@mramato
Copy link
Contributor

mramato commented Jan 3, 2019

My thinking is if show is undefined, the behavior is whatever we decide we want it to be, and undefined is usually false.

Sounds like clear enough reasoning to me. I'll merge when green. Thanks!

@hpinkos
Copy link
Contributor Author

hpinkos commented Jan 3, 2019

@mramato ready

@mramato mramato merged commit c7b1fe6 into master Jan 3, 2019
@mramato mramato deleted the fix-entity-show-interval branch January 3, 2019 21:20
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