Skip to content

Tracked entity not tracked while another data source is loading #6556

Open
@lilleyse

Description

@lilleyse

A tracked entity does not get tracked while another data source is loading. Is this a bug or intentional?

The area of the code that is suspicious is Viewer._onTick and DataSourceDisplay.getBoundingSphere. An entity is only updated if its bounding sphere is DONE, but getBoundingSphere returns PENDING if any data sources are loading (_ready will be false). This causes the entity to not get updated and the camera doesn't have a new position to track.

A possible fix would be to check only the ready state of the data source containing the tracked entity. But someone more familiar with the code might have a better idea.

Sandcastle demo

var viewer = new Cesium.Viewer('cesiumContainer', {
    shouldAnimate : true
});

viewer.allowDataSourcesToSuspendAnimation = false;

var truckPromise = viewer.dataSources.add(Cesium.CzmlDataSource.load('../../SampleData/MultipartVehicle_part1.czml'));
truckPromise.then(function(czmlDataSource) {
    viewer.trackedEntity = czmlDataSource.entities.getById('Vehicle');
});

window.setTimeout(function() {
    viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_us_states.topojson'));
}, 1000);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions