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

Create a trackedTileset property? #7086

Closed
OmarShehata opened this issue Sep 27, 2018 · 5 comments
Closed

Create a trackedTileset property? #7086

OmarShehata opened this issue Sep 27, 2018 · 5 comments

Comments

@OmarShehata
Copy link
Contributor

This just came up on the forum. You can currently set the trackedEntity to a tileset, and the camera will zoom to it but won't stay there.

It sounds like it would be a pretty useful thing to have to be able to track tilesets in the same way as entities. I think it would only need a small tweak to EntityView.js. The question is, what would be the cleanest way to do it? Renaming trackedEntity to something more general?

@hpinkos
Copy link
Contributor

hpinkos commented Sep 27, 2018

From an API standpoint, I've been wondering if there is confusion between using scene.primitives.add to add 3D tiles and viewer.entites.add to add pretty much everything else. I would if it would make sense to add 3D tiles to the Entity API. @mramato what are your thoughts on this?

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 28, 2018

Please discuss with me before moving forward with it...and I also would not consider this a priority now.

@OmarShehata
Copy link
Contributor Author

This is related, slightly different, but potentially more useful: being able to zoomTo or flyTo features in 3D Tiles. Use case is described in this forum thread:

Consider the following workflow:

  1. Instantiate a 3D tiles tileset, each model of which is batched and contains per-feature information
  2. Manually pan and zoom around the scene to a particular part of the tileset
  3. Click on a feature in a model in the tileset. The click is caught via:
    let new_feature = this.viewer.scene.drillPick(movement.endPosition, 1 /* number of items max */);
  4. Attempt to zoom to that feature. Options considered include this.viewer.zoomTo(new_feature.primitive);, but this zooms to the entire tileset or model.

@OmarShehata
Copy link
Contributor Author

You can now add 3D Tiles through the entity API as of #8580! So you can now do:

var viewer = new Cesium.Viewer('cesiumContainer');
var tilesetEntity = viewer.entities.add({
    tileset: {
        uri: Cesium.IonResource.fromAssetId(5741)
    }
});
viewer.flyTo(tilesetEntity);

Which solves the flyTo and tracking issue presented here.

@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/d/msg/cesium-dev/uc1SoWvzBks/gMEGPsScCwAJ

If this issue affects any of these threads, please post a comment like the following:

The issue at #7086 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

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

No branches or pull requests

4 participants