1

I've a layer who contain many parameters like number. I try to "navigate" in this layer for make a specific action.

The schematic structure of my layer look like :

object : [a] - item (1) - [o] - name (Name layer) - [o] - source (14) - [o] - number (14)

for take the name of my layer I'wrote (return "Name layer") :

map.getLayers().item(1).get('name')

but if I want to make an action on the layer "Name layer" and the number "14", how can I do that ?

I tried : map.getLayers().item(1).get('name').item(14).get('number');

But it's don't that.

1

I find the solution. You can make a loop in your object like that :

for (var a = 0; a < length; a++) {

    console.log (layers.a[i].o['source'].o[a].o['number']);

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.