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 setZIndex function #1084

Merged
merged 4 commits into from
Aug 2, 2018
Merged

Add setZIndex function #1084

merged 4 commits into from
Aug 2, 2018

Conversation

appleshowc
Copy link
Contributor

增加了手动设置和自动设置图层 zIndex 值的方法。
在初始化设置了 position 参数时,自动设置图层 zIndex 值(遍历所在 pane 里的所有图层,设置最大(front)或最小(back)值)。
在初始化设置了 zIndex 参数时,position 参数的默认值失效,直接使用该值作为图层zIndex值。
如果之后手动调用 bringToFront 或 bringToBack 方法,之前手动设置的zIndex失效,自动分配图层 zIndex 值。
-----------------------------渣翻译分割线--------------------------
if set position option, it will auto set the image dom zIndex. (go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back))
if set zIndex option, it will use the value as the image dom zIndex.
if call bringToFront / bringToBack function, though set zIndex option in initialize, it will auto set the image dom zIndex.

增加了手动设置和自动设置图层 zIndex 值的方法。
在初始化设置了 position 参数时,自动设置图层 zIndex 值(遍历所在 pane 里的所有图层,设置最大(front)或最小(back)值)。
在初始化设置了 zIndex 参数时,position 参数的默认值失效,直接使用该值作为图层zIndex值。
如果之后手动调用 bringToFront 或 bringToBack 方法,之前手动设置的zIndex失效,自动分配图层 zIndex 值。
-----------------------------渣翻译分割线--------------------------
if set position option, it will auto set the image dom zIndex. (go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back))
if set zIndex option, it will use the value as the image dom zIndex.
if call bringToFront / bringToBack function, though set zIndex option in initialize, it will auto set the image dom zIndex.
@jgravois
Copy link
Contributor

jgravois commented Apr 9, 2018

thank you for this @appleshowc!

my gut reaction is that it is preferable to use the map pane functionality that is present in Leaflet itself instead of relying on z-index to control layer order.

let me know if that's not feasible for some reason.

@appleshowc
Copy link
Contributor Author

Thanks for replay!
I have some layers managed by group, contains tile, dynamic and other type layer in one group. Groups order can be adjusted, but layers order in one group are fixed.
If one layer in one map pane, there are too many panes to manage, and it's hard to control the group order.
For convenience of adjusting the order between groups or layers in one group, I choose one group in one map pane, and use z-index to fix layers order in one group.
It's a suggestion~

@jgravois
Copy link
Contributor

jgravois commented Jul 8, 2018

thanks for taking the time to explain in more detail and my apologies for delay in responding.

i'd be interested in testing this new feature and hopefully getting it landed. can you resolve the lint errors travis is reporting so that the CI tool can get past that step and run our actual test suite?

@appleshowc
Copy link
Contributor Author

I'm glad to receive your reply @jgravois !
And of course yes!
BUT there is still errors that I don't know how to fix.
It confused me. What I submitted is just "RasterLayer.js". However, the errors occurs in other places...sad...

@jgravois
Copy link
Contributor

jgravois commented Jul 9, 2018

the errors occur in other places...

we can blame #1038 for that. there is nothing that would make me happier than learning how to fix that particular problem.

i restarted the build (twice) and i'm seeing green now.

@jgravois
Copy link
Contributor

jgravois commented Aug 2, 2018

it took me way longer than it should have to pull down this code and take a close look at it.

thanks for your patience! its a great patch.

@jgravois jgravois merged commit 51de281 into Esri:master Aug 2, 2018
@appleshowc appleshowc deleted the appleshowc-patch-1 branch August 3, 2018 11:46
jgravois added a commit to jgravois/esri-leaflet that referenced this pull request Apr 23, 2022
Add setZIndex function to dynamic/imageMapLayer
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.

2 participants