Reputation: 121
I am trying to get some key values from features in extent but I am unable to.
I tried to look up ID [feature.getId()] which works totally fine, see here:
If I try feature.get('id') it's undefined for some reason. (And it's undefined for every key I am trying to get by name)
I tried feature.getKeys() and it's returning geometry,info,index,popup.
I stored every info I need under info key.
I tried to get data in console and I can see that a point has 'id' key, and I am unable to get it with feature.get('id')
Does anyone know what am I doing wrong?
Upvotes: 1
Views: 743
Reputation: 121
I had to access values with Object.values method.
Object.values(Object.values(feature.get("info"))[0][2])[1]
Upvotes: 1