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

Error removing CZML datasource when start and end time in clock interval are the same #9097

Closed
fc opened this issue Aug 18, 2020 · 3 comments · Fixed by #9637
Closed

Error removing CZML datasource when start and end time in clock interval are the same #9097

fc opened this issue Aug 18, 2020 · 3 comments · Fixed by #9637

Comments

@fc
Copy link

fc commented Aug 18, 2020

It seems to only throw an error when using the result from the promise.

Code:

var viewer = new Cesium.Viewer("cesiumContainer");
async function doIt() {
  var czml = [
    {
      "id":"document",
      "version":"1.0",
      "clock":
        {
          "interval":"2020-01-01T00:00:00+00:00/2020-01-01T00:00:00+00:00",
          "currentTime":"2020-01-01T00:00:00+00:00",
          "multiplier":30,
          "range":"CLAMPED",
          "step":"SYSTEM_CLOCK_MULTIPLIER"
        }
    }
  ];
  var dataSourcePromise = Cesium.CzmlDataSource.load(czml);
  viewer.dataSources.add(dataSourcePromise);
  const dataSource = await dataSourcePromise;
  viewer.dataSources.remove(dataSource);
}


doIt();

Error:

Uncaught (in promise) TypeError: this._dataSourceChangedListeners[id] is not a function
    at Viewer._onDataSourceRemoved (VM332 Cesium.js:304106)
    at Event.raiseEvent (VM332 Cesium.js:14039)
    at DataSourceCollection.remove (VM332 Cesium.js:195798)
    at doIt (<anonymous>:24:22)

Sandcastle example:
https://sandcastle.cesium.com/#c=jVJdT9swFP0rVp5SjTkpe2tDNRT6UC0V1VqQ0IyQcS5g4diVP1KVaf99jh3WQEFaYjnxPfecY/velmrUctiBRmdIwg6VYLhr8HWIpSRhYV0qaSmXoEkymhJJzV4y9OAks1xJVKuFTUfoN5EItV6QvTTCy/3q1iiGu4ckvCbJhCS1Yq4BaUlycsAkbSCg10p41LwBW9DGOwV8jPM3GBOKPXdIHxk49q7Sgm6pCOzT/DT/mo/92OT5JIwvYc4+RQZuvaPT2m9/w/sd/z+zccLyreDdRU6+5e9QTeVjVCyr8+VqfnHENxa2IWF9s97Ml3dldVn+uFteVZvFqlrMf5LkkP8n/obP7fS1NjW1dK2cZrDSquEGfKH6mpe+bBf/YCwUrdOulKNIDh2BD3yDaV2nR3oxmylp7MDMu9Ad5fbY/zNxDY1qYaDfCfvDdG9suGlykhTG7gXMXk/9nTdbpS1yWqQYZxaaraAWTHbv2DNYzIyJ+0OoyIbUouYt4vXZBw2PmKDGeOTBCbHmL75CsyLz+UfU7sa4fLz03Srovkt7Gs+qGMQYF5lffsy0Sol7qgfKMeMv

Browser:
Chrome

Operating System:
macOs

Workaround / prevention:
Don't allow clock interval have the same start/end time.

@OmarShehata
Copy link
Contributor

@fc this Sandcastle doesn't throw an error for me. Are you seeing different behavior?

@mramato
Copy link
Contributor

mramato commented Aug 18, 2020

@fc change doIt(); to doIt().catch(e => console.log(e)); and you'll see the error.

Looks like a clear cut bug to me (should hopefully be an easy fix as well)

@fc
Copy link
Author

fc commented Aug 18, 2020

On the sandcastle, the exception displays in the browser console without needing to log it.

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

Successfully merging a pull request may close this issue.

3 participants