# How to get properties from 3dtiles next data when click

**URL:** <https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929>\
**Category:** CesiumJS\
**Created:** [January 18, 2022, 4:27am UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929 "2022-01-18T04:27:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gu-Miao](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gu-miao/32/6222_2.png) [@Gu-Miao](https://community.cesium.com/u/Gu-Miao)\
**Post date:** [January 18, 2022, 4:27am UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/1 "2022-01-18T04:27:18Z")

</div>

I have a new 3dtiles next data for test today. I add a left click listener and I find that I can only get a object that contains `content`, `detail` and `primitive` instead of a `Cesium3DTileFeature` instance before.

I can use `feature.getPropery('some name')` before, but now, how to do the same?

 ![image](https://global.discourse-cdn.com/cesium/original/2X/e/e9abbbafda9006668c2828e6c4c099e249c23592.jpeg)

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [January 18, 2022, 6:59pm UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/2 "2022-01-18T18:59:32Z")

</div>

Hi @Gu-Miao,

I would call `var propertyNames = feature.getPropertyNames();` to ensure that you are querying the correct value when calling `getProperty`. Acording to our documentation, `feature.getPropery('some name')` is still part of our API.

[https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileFeature.html](https://cesium.com/learn/cesiumjs/ref-doc/Cesium3DTileFeature.html)

Best,  
Sam

---

<div class="post-metadata">

**Author:** ![Gu-Miao](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gu-miao/32/6222_2.png) [@Gu-Miao](https://community.cesium.com/u/Gu-Miao)\
**Post date:** [January 19, 2022, 1:48am UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/3 "2022-01-19T01:48:22Z")

</div>

Hi @sam.rothstein

I know that. But what I said is I can’t get a instance of `Cesium3DTileFeature` when call `viewer.scene.pick()`. Instead, I get a object which has `content`, `detail` and `primitive`. And I can’t get properties from them.

Also, I check 3dtiles next examples on sandcastle, I find all of them can get a feature instance when click. So I aslo have a doubt that the data may have some problems if I can’t get a feature instance?

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [January 19, 2022, 1:41pm UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/4 "2022-01-19T13:41:09Z")

</div>

It’s indeed hard to say exactly what might be the reason. Is it possible to share the data set, maybe as a ZIP file, so that others can have a look? (Otherwise, I could try to have a look at other existing 3D Tiles Next samples, and try to find possible reasons for why you are not receiving a `Cesium3DTileFeature` there…)

---

<div class="post-metadata">

**Author:** ![ptrgags](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ptrgags/32/4938_2.png) [@ptrgags](https://community.cesium.com/u/ptrgags)\
**Post date:** [January 19, 2022, 3:34pm UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/5 "2022-01-19T15:34:54Z")

</div>

Hi @Gu-Miao,

First of all, thanks for trying out 3D Tiles Next!

The reason you’re getting an object with `detail` and `primitive` rather than a `Cesium3DTileFeature` is that it’s not finding your feature IDs for some reason, so it falls back to picking the entire glTF model representing the tile.

Feature ID picking in CesiumJS does have a couple open issues that may be the cause of this problem. These issues are under active development right now:

- [Handle multiple sets of feature Ids in `ModelExperimental` · Issue #10007 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/10007)
- [`ModelExperimental` EXT\_mesh\_features: handle feature IDs without a property table · Issue #9884 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/9884)

Like @Marco13 said, knowing more about your data would be helpful here. In particular, I’m curious:

1. What types of feature IDs (attribute, implicit attribute, or texture) are you using?
2. How many sets of feature IDs are stored in each primitive? Only the first set of feature ID attributes/textures will be used by default. In the near future, this will become easier to configure.

---

<div class="post-metadata">

**Author:** ![ptrgags](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ptrgags/32/4938_2.png) [@ptrgags](https://community.cesium.com/u/ptrgags)\
**Post date:** [January 19, 2022, 4:20pm UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/6 "2022-01-19T16:20:55Z")

</div>

I just realized that you haven’t mentioned whether you’re using `3DTILES_metadata` or the corresponding glTF extension (`EXT_mesh_features`). My comment above was referring to the latter.

If you’re asking about tileset or tile metadata from `3DTILES_metadata`, it is possible to access the metadata, though you have to use the private API a bit.

I opened a new issue [Streamline the API for accessing tileset/tile metadata when picking · Issue #10015 · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/issues/10015) about this. The issue includes code snippets of how to access the metadata with the current code.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [January 19, 2022, 7:15pm UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/7 "2022-01-19T19:15:21Z")

</div>

An example sandcastle showing _one possible way_ of obtaining per-tile metadata:

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=rVd7b9s2EP8qrAfUMuJJzroBg50Ua1O3NdbEBeylGKahoKWzzZYiBZGykw757js+JNOxne2POvBD5L3vfneXJCFjQRccCNyVULEChKacLIHqugJFlrIiBWiaU00JzTJQKhVXoFhdxOOA461niMFKu5Y58PCeXBJd1TBKRSo2tCIbBluo8FTAlnh5t/Ys6mb28UoiHxNQdXstlwalr6gC5Es7aQfP904E3Olkzjgo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P1KPoB33btX65bAZNSBkIOFYtTws6xjFqo/LIpOfPybPjSv5HSPxN4HYL+4kxi3MLiDUVOUf47LYM7CtmbNkg4gZjACYsqeUtZI37jwGB3GAfQATnpC7z/ZUF3AZyghMZK6IkWrY28q3mFpABak2MG/P21s1ZVgGImVlFxthF9HtHFO1tfxlFAcr0Vy8jxu1hIspav3IYa8BGIuOKWXZ9VE/00XZz9bPF1tjBzomnrTzcvPKPUjGjxTV68z4YEE6QHQ0O1SNHZpfJFVQtZ7PrBqV22EaiUMjhjoEK52F3NGpDmb09bVmzYB3zs3HtCX/DUJb+BkW1YkdOFdZm/1Ry5/clxNfTP2bjz9fT27FbtXZ/nX7nQul7Di8dIAj5jRWlrLTZ5qM4TjQgfrA8VbKoMTA6zpRqpu5FErJe5GxDWH6Zdh79H4P7UsapUnizrDmfsW84yF9eJEh/wMolNXv/FGscV3VDtj5/+cEdxnF8keDjcU4tJV/Q6pHkfwE)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

This shows the metadata of tiles in a tooltip, using the [https://github.com/CesiumGS/3d-tiles-samples/tree/main/next/TilesetWithTileMetadata](https://github.com/CesiumGS/3d-tiles-samples/tree/main/next/TilesetWithTileMetadata) as an example.

But **note** that the implementation of the `obtainTileMetadata` is preliminary, and some details might change here in future versions.

---

<div class="post-metadata">

**Author:** ![Gu-Miao](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gu-miao/32/6222_2.png) [@Gu-Miao](https://community.cesium.com/u/Gu-Miao)\
**Post date:** [January 20, 2022, 3:15am UTC](https://community.cesium.com/t/how-to-get-properties-from-3dtiles-next-data-when-click/16929/8 "2022-01-20T03:15:46Z")

</div>

Hello @ptrgags @Marco13, Thanks for the answers!

It’s seem to be a problem of data itself. I show my back-end colleague this post and he tell me there are no feature ids nor metadata properties because he didn’t learn very futher yet. We’re learning further about that and we’d like to share if we find something new.

Your answers have given us great inspiration and useful information, thanks again!
