OpenLayers Map addLayer and getLayers methods dealing with custom layer types
问题 I am extending LayerGroup and TileLayer classes to include an id property that I need to identify a specific layer/group of layers (this also reflects an id of a layer DIV in the DOM). Example for TileLayer : export class OperationalLayer extends TileLayer { id: String; constructor(url: string, name: string, id: string) { const source = new TileWMS({ params: {'LAYERS': name}, url: url, }); super({source: source}); this.id = id; } } I also have another class which extends the ol Map class.