billy-poon / echarts-amap

an echarts extension to support AMap(http://lbs.amap.com/)
MIT License
60 stars 31 forks source link

Set CustomLayer's zIndex to 130 #3

Closed yuxincs closed 7 years ago

yuxincs commented 7 years ago

Currently the echarts layer (which is the AMap's CustomLayer)'s zIndex is not set and the default seems to be 11, however the amap-labels and amap-markers layer's zIndex's default value seems to be 99 and 120. Thus the echarts layer is not on top of all layers which in turn mouse operations won't have any effect on the echarts instances.

Setting the zIndex when creating the CustomLayer will fix the problem.

billy-poon commented 7 years ago

Sorry, i don't think this feature is necessary everywhere, so i am not merging this PR.

Maybe you can fix this by

var layer = echartInstance.getModel().getComponent('amap').getLayer();
layer.setzIndex(200)

See the /index.html file of this project.

yuxincs commented 7 years ago

Oh yes you're correct, the code makes sense.