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

Internal vector layer handling #1799

Merged
merged 5 commits into from
Apr 20, 2022

Conversation

okauppinen
Copy link
Contributor

@okauppinen okauppinen commented Apr 12, 2022

Remove z index from hover layer and add/move hover layer one step above hovered layer.

Add addInternalLayer method for mapmodule which sets z index for layer to keep internal layer above 'normal' layers. Mapmodule has method for ordering layers by z index which is used AfterRearrangeSelectedMapLayerEvent.
https://github.com/oskariorg/oskari-frontend/blob/develop/bundles/mapping/mapmodule/MapModuleClass.ol.js#L971

Don't know if z indexes were used but at least didn't find current usage. Maybe it could be removed or order layers also on addLayer. Layers could be also added directly to ol map which isn't handled by mapmodule. So the order in map's layer collection/array may vary (even mapmodule addLayer sorts array by z index).
"At rendering time, the layers will be ordered, first by Z-index and then by position"

Removed bringToTop from vectorlayerplugin because it was used only after addLayer which already adds it on top.

* @method bringToTop
* @param {ol/layer/Layer} layer ol specific!
*/
addInternalLayer (layerImpl) {
Copy link
Member

@ZakarFin ZakarFin Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would something like addOverlayLayer() be more descriptive name? It's not perfect either since there's already a concept of an "overlay" in OpenLayers but I think it could be better.

@ZakarFin
Copy link
Member

Even with this it's a matter of functionality starting order that changes markers/draw layers/runtime vector layers relative placement to each other. But this removes the need to bump them to the top every time the layer order changes since layers with z-index are always on top of "regular" layers. I think having "bringToTop" is good to have, but I'm not sure if we should clarify what it does (bringing a layer to top of regular layers with these "internal/overlay" layers still on top of that?)

@ZakarFin ZakarFin added this to the 2.8.0 milestone Apr 20, 2022
@ZakarFin ZakarFin merged commit 00c33ad into oskariorg:develop Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants