In the API version 2.3.X and lower there was a lovely WebMap object method called get_layer() that allowed you to retrieve the layer definition using a title parameter and supplying in the name of the layer as a string. See the docs here.
With 2.4.0 this neat functionality has been removed. We now access the layer via m.content.layers[index_position], which means I need to know the index of the layer in the first place. I now have to write a custom method to get the layer of interest based on the title!
Please reinstate this functionality and bring back a way for us to get the WebMap (Map) layer by the layer title!
Thanks for posting this. When making such a big shift it's difficult to gauge the importance of certain methods and properties that were previously available.
Since a lot of methods now rely on layer index we will make a method that allows you to get the layer and the index of said layer more easily.
Why would you remove this? Please bring it back
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.