Zoom to visible 3d tiles

I'm trying with 3d tiles,because my project project has grown in data and I have a doubt.
How can I go through each building (all, not only visible) with the example of ny? On the other hand, how can I zoom in the bounding box of several show=true entities, just as can be done with kml?

This features are posible using viewer.datasource but using 3d tiles i dont have idea

Thanks for your help and cesium ion is a killer server

Once a tileset is ready, you can actually use viewer.zoomTo to get to it. So it would look like this:

tileset.readyPromise.then(function() {
viewer.zoomTo(tileset);
});

``

For zooming in to particular features, the Cesium ion 3D Tiling pipeline will save metadata per feature. For the NYC each building has a longitude/latitude properties saved on it, so you can use that to zoom in. Check out this Sandcastle:

Select the “Zoom to metadata” radio button, then right click on any building. Let me know if this does what you need. And thanks for your kind words! Glad you’ve been enjoying using Cesium ion. We’re constantly improving it so if you have feedback or ideas for features let me know here or feel free to post on the ion community repo (https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D%20Tiles%20Interactivity.html).

Thanks for a quick response.

I know those examples!

The problem is to only zoom the visible ones, for example, in https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=3D%20Tiles%20Feature%20Styling.html, click on “hide by height” and many buildings disappear, but some are the ones that fulfill the condition.

How can I zoom to the buildings that it meets:

‘$ {height}> 200’

using kml i make array of entities,but in 3D Tiles?

Extract which buildings meet that condition?I don’t Know

thanks

I think you would have to do something similar to what you would do with KML. After you apply the style to your tileset, you’d have to iterate through all the tiles and their features, collect the ones that are not hidden (perhaps by checking their .show property) and then you can potentially average their long/lat positions to figure out where to zoom to.

Is that similar to what you’d done before with KML? Perhaps one thing that CesiumJS can do to make it easier is to allow the camera to zoom in to any given set of entities/models. If you do end up implementing this it’d be awesome to post it here (or even better, contribute the code back to Cesium!)

thanks

this is the question,how Can i
iterate through all the tiles and their features, collect the ones that are not hidden (perhaps by checking their .show property ?? this is the question

When I have that, it is easy to implement the zoon if we have latitude, longitude, area and height for each building.

regards

Francisco raga ** | **Desarrollador GIS de código abierto de pila completa

Móvil: (+34) 654275432 | e-Mail: franka1986@gmail.com | skype: francisco_raga
Github: https://goo.gl/ydNTjY **| **Linkedin: https://goo.gl/TCfj8S **| **Site: https://goo.gl/qiypDj

“La vida real no tiene ningún mapa…” Ivy Compton Burnett

Given a tileset, you can get its root property, which is a Cesium3DTile. Each tile has a children property as well as a content property. The Cesium3DTileContent can tell you the featuresLength, and you can use the content.getFeature from 0 up to the length to get all the features. And finally, a Cesium3DTileFeature has a show property.

Note that you’ll only be able to get the content for tiles that are already loaded, so ones that already on screen. So perhaps a good way to do this is to zoom the camera to the whole tileset, apply the style, then do this iteration/collection.

Thank you very much for your reply

I will try that way and publish the solution

regards