# zoomTo() and Features in Batched Models

**URL:** <https://community.cesium.com/t/zoomto-and-features-in-batched-models/7905>\
**Category:** CesiumJS\
**Created:** [January 18, 2019, 12:11am UTC](https://community.cesium.com/t/zoomto-and-features-in-batched-models/7905 "2019-01-18T00:11:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Mitchell](https://avatars.discourse-cdn.com/v4/letter/c/aca169/32.png) [@Christopher\_Mitchell](https://community.cesium.com/u/Christopher_Mitchell)\
**Post date:** [January 18, 2019, 12:11am UTC](https://community.cesium.com/t/zoomto-and-features-in-batched-models/7905/1 "2019-01-18T00:11:47Z")

</div>

Is it possible to zoomTo() or flyTo() the extents of a feature in a batched model? 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 \*/);

1. Attempt to zoom to that feature. Options considered include this.viewer.zoomTo(new\_feature.primitive);, but this zooms to the entire tileset or model.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [January 23, 2019, 1:50pm UTC](https://community.cesium.com/t/zoomto-and-features-in-batched-models/7905/2 "2019-01-23T13:50:27Z")

</div>

I think that would be a pretty useful feature! Thanks for describing your workflow and use case That always makes it easier to make decisions when implementing things. I documented a feature request here:

> <https://github.com/CesiumGS/cesium/issues/7086#issuecomment-456805789>
>
> This just came up on the forum. You can currently set the trackedEntity to a tileset, and the camera will zoom...

In the mean time, I think you might have to roll your own custom zoomTo feature here. I think you can get the batched model from the tileset, and use its properties (location/dimensions) to compute a fly position. This is the closest example I know of for manipulating models in a tileset:

> <https://github.com/CesiumGS/cesium/issues/7139#issuecomment-447920237>
>
> Add option to clamp 3D Tileset features relative to ground at runtime, similar to https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html?src=Geometry%20Height%20Reference.html

If you get it working, it’d be awesome to post a code sample on here (Or even better, contributing a pull request back to Cesium!)
