-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Hello,
We need to have the layers correctly ordered on the map.
To be more clear, if we add to the map this list of layers:
<layer1></layer1>
<layer2></layer2>
<layer3></layer3>
layer3 has to be displayed over layer2 which has to be displayed over layer1.
In OpenLayers, it is possible to order the layers without the use of the parameter zIndex, by just ordering the list of layers given to the map.
ngx-openlayers currently adds the layers to the map as soon as they are created, without any information on the order (see in layer.component.ts: this.host.instance.getLayers().push(this.instance);).
I have created a fix that adds a parameter "index" to the layer components which does the job, but I don't really like this solution as it does not follow OpenLayers API.
You can see it here: https://github.com/airbusgeo/ngx-openlayers/tree/feat-layer-order (branch feat-layer-order).
Has anyone face the same problem? Any better idea to fix it?