# Getting layer properties from Tiled

**URL:** <https://phaser.discourse.group/t/getting-layer-properties-from-tiled/5454>\
**Category:** Phaser 3\
**Created:** [March 9, 2020, 7:52pm UTC](https://phaser.discourse.group/t/getting-layer-properties-from-tiled/5454 "2020-03-09T19:52:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SirFarq](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@SirFarq](https://phaser.discourse.group/u/SirFarq)\
**Post date:** [March 9, 2020, 7:52pm UTC](https://phaser.discourse.group/t/getting-layer-properties-from-tiled/5454/1 "2020-03-09T19:52:45Z")

</div>

I can’t believe how difficult a time I’m having understanding this…

In my scene I am trying to read a custom **layer** property from Tiled. I have no issue grabbing custom properties from individual tiles or objects in an object layer for example but the following code:

```javascript
console.log(this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties.depth)
```

returns `undefined`

So, to try and figure out what was being held in properties, I used:

`this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties.forEach((p) => {
            console.log(p);
});
`

and got…

```javascript
{name: "depth", type: "int", value: 0}
```

I know i’m having a brainfart but can someone please explain how I can access the custom layer property’s value as I’m tearing my hair out.

---

<div class="post-metadata">

**Author:** ![SirFarq](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@SirFarq](https://phaser.discourse.group/u/SirFarq)\
**Post date:** [March 9, 2020, 8:09pm UTC](https://phaser.discourse.group/t/getting-layer-properties-from-tiled/5454/2 "2020-03-09T20:09:32Z")

</div>

Never mind, brainfart over.

```javascript
this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties[0].value
```

or alternatively, iterate over the array of custom properties to check `properties[i].name` and pair it to the `properties[i].value` if anyone is wondering
