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

Add option to control layer insertion position in addLayer action #1198

Merged
merged 1 commit into from
Oct 24, 2016

Conversation

manisandro
Copy link
Contributor

Not sure if this is the proper approach, but I didn't find any way to control the position a layer is added. By default it seems new layers are always added behind all non-background layers, but we need a way to add the new layer on top.
If this approach is correct I'll add tests.

@simboss simboss added the ready label Oct 24, 2016
Copy link
Contributor

@mbarto mbarto left a comment

Choose a reason for hiding this comment

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

Please, add a unit test

@manisandro
Copy link
Contributor Author

So this means that the approach is ok?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 80.903% when pulling d2534e0 on sourcepole:addlayerpos into 3c17884 on geosolutions-it:master.

@mbarto
Copy link
Contributor

mbarto commented Oct 24, 2016

The standard behaviour is to have layers ordered from bottom to top in the order they are listed in state.layers.flat. This order is created in LayersUtils.sortLayers by browsing the TOC so that layers that are at the bottom of the TOC are also at the bottom of the map stacking order. So, in theory, your approach should work.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 80.903% when pulling c024ad9 on sourcepole:addlayerpos into 3c17884 on geosolutions-it:master.

@mbarto mbarto merged commit 5e80383 into geosolutions-it:master Oct 24, 2016
@mbarto mbarto removed the ready label Oct 24, 2016
@manisandro manisandro deleted the addlayerpos branch October 24, 2016 14:30
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 this pull request may close these issues.

None yet

4 participants