I have built a WMS parser which I am using to retrieve all layers from a WMS url to be able to automatically build a OL map with those layers inside.
Actually, I see I can do it in two modes:
- MODE 1: making a
ol.source.ImageWMSinstance for each layer and append it to a layer_list array (to be used as
- MODE 2: making only one instance of
ol.source.ImageWMSwith all the layer names inside the
To my understanding, the MODE 1 should make a new request for each layer to the same WMS url, and this have the disadvantage of slowing the process, but the advantage of maybe handling the layers easier (e.g turing them on and off, zooming to one specific layer, etc.)
MODE 2 however migt be harder to handle in terms of single layer, but it's only one WMS request.
I am new to OL.
Which mode is more efficient?