mardi 9 février 2016

Reach layer name property from a layer group in OpenLayers3

I have a layer group consisting of 3 layers and named for example: group1.

I want to produce an array of the names of the layers that are in this group. I'm actually doing that:

group1.getLayers().getArray()

I'm reaching the level of the ol.layer.vector, but I can't seem to find how to access the value of the name propertie.

My guess was to do add a .get("name") after the getArray() but it doesn't work (I guess you can't call more than 2 methods). I also tried stocking the results of the getArray() in a variable, but then I can't do a get("name") on the variable.

How can I access my layers name ?

Edit: Looks like I can use the getLayersArray() method also, but I'm stuck with the same problem.




Aucun commentaire:

Enregistrer un commentaire