Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layers order #141

Open
samuel-girard opened this issue Dec 28, 2017 · 1 comment · May be fixed by #154
Open

Layers order #141

samuel-girard opened this issue Dec 28, 2017 · 1 comment · May be fixed by #154

Comments

@samuel-girard
Copy link

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?

@samuel-girard
Copy link
Author

Implemented in #144

@samuel-girard samuel-girard linked a pull request Feb 6, 2018 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant