Can I create a property that is named "name" and add it to the instance I created from this layer?
var osm = new ol.layer.Tile({
name: "pepe",
source: new ol.source.OSM()
})
What I want to do is differentiate this layer from another by that name. And so do search conditions. For example: If it's called Pepe, I want this layer.
I found something. Using console.log, the structure of this object to reach the name is like this:
osm.N.name
Is this the way?