# feature.getPropertyNames is not a function

**URL:** <https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014>\
**Category:** CesiumJS\
**Created:** [November 13, 2023, 6:17am UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014 "2023-11-13T06:17:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehmet\_emin\_yalcin](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mehmet_emin_yalcin/32/20379_2.png) [@mehmet\_emin\_yalcin](https://community.cesium.com/u/mehmet_emin_yalcin)\
**Post date:** [November 13, 2023, 6:17am UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/1 "2023-11-13T06:17:01Z")

</div>

I am trying to get 3D Tile feature that selected. I used viewer.scene.pick function before and got results but I dont know why it dont be returned again . Every time when I want to get feature picked, cesium returns object that has content,detail,id and tileset. I am using react typescript and cesium 1.111 version.  
Here is my code and image of feature object

```auto
const viewer = new Viewer('cesiumContainer', {
  terrain: Terrain.fromWorldTerrain(),
  timeline: false,
  animation: false,
  homeButton: false,
  geocoder: false,
  baseLayerPicker: false,
  sceneModePicker: false,
  navigationHelpButton: false,
  sceneMode: Cesium.SceneMode.SCENE3D,
  mapProjection: new Cesium.WebMercatorProjection(),
});
viewer.screenSpaceEventHandler.setInputAction(function (movement: any) {
  var feature = viewer.scene.pick(movement.position);
  if (feature instanceof Cesium.Cesium3DTileFeature) {
    feature = feature as Cesium.Cesium3DTileFeature;
    var propertyNames = feature.getPropertyNames();
    var length = propertyNames.length;
    for (var i = 0; i < length; ++i) {
      var propertyName = propertyNames[i];
      console.log(
        propertyName +
          ': ' +
          feature.getProperty(propertyName)
      );
    }
  }
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);

```

 ![image](https://global.discourse-cdn.com/cesium/original/3X/9/6/96e78fe1f1b5b858a7efb6d58a0c591fec03e9a0.png)

How can I fix this?

---

<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:** [November 13, 2023, 2:33pm UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/2 "2023-11-13T14:33:04Z")

</div>

A quick guess, based on the title and a _very_ quick look at the code: I think it should be `getPropertyIds` (instead of `getPropertyNames`). If this does not help, it may be necessary to take a closer look…

---

<div class="post-metadata">

**Author:** ![mehmet\_emin\_yalcin](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mehmet_emin_yalcin/32/20379_2.png) [@mehmet\_emin\_yalcin](https://community.cesium.com/u/mehmet_emin_yalcin)\
**Post date:** [November 13, 2023, 3:01pm UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/3 "2023-11-13T15:01:27Z")

</div>

Thank you for your response Marco 13. But looking at the image of the feature object we can also see that cesium returns an invalid object even though the tile has objects.  
I used fromUrl funtion with featureLabelId property to add 3D tile , When I remove {featureIdLabel:layer.Id} the problem was resolved. The code worked incorrectly is like below

```auto
const provider = await Cesium.Cesium3DTileset.fromUrl(
    getCesiumResourceByUrl(layer.Url),{featureIdLabel:layer.Id}
  );
  const tileset = viewer.scene.primitives.add(provider);

```

---

<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:** [November 13, 2023, 3:24pm UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/4 "2023-11-13T15:24:49Z")

</div>

It is not entirely clear for me whether the issue is reolved now.  
If not: You mention the `featureIdLabel`, which raises some questions about the exact input data structures: Are you using glTF tile content with the `EXT_mesh_features` extension?  
(This thread will likely be moved to the ‘CesiumJS’ category soon, maybe someone can provide more detailed guidance there…)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [November 14, 2023, 3:06pm UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/5 "2023-11-14T15:06:10Z")

</div>

According to the documentation for `featureIdLabel`, this is expected behavior:

> Label of the feature ID set to use for picking and styling. For EXT\_mesh\_features, this is the feature ID’s label property, or “featureId\_N” (where N is the index in the featureIds array) when not specified. EXT\_feature\_metadata did not have a label field, so such feature ID sets are always labeled “featureId\_N” where N is the index in the list of all feature Ids, where feature ID attributes are listed before feature ID textures. If featureIdLabel is an integer N, it is converted to the string “featureId\_N” automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.

I believe this option was added when support for 3D Tiles 1.1 was added. Under the hood, this uses glTF and the `EXT_mesh_features` extension as @Marco13 mentions.

---

<div class="post-metadata">

**Author:** ![mehmet\_emin\_yalcin](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mehmet_emin_yalcin/32/20379_2.png) [@mehmet\_emin\_yalcin](https://community.cesium.com/u/mehmet_emin_yalcin)\
**Post date:** [November 14, 2023, 3:22pm UTC](https://community.cesium.com/t/feature-getpropertynames-is-not-a-function/28014/6 "2023-11-14T15:22:04Z")

</div>

Thank you @Gabby_Getz and @Marco13 . I rhink I missed it
