图层插队

/*
* 图层插队
* 参数1:要插队的图层layer
* 参数2:插队在谁之后图层的id
* 用法:that.StaticMap.LayerJump(layer,'id')
* */
function LayerJump(layer,fatherid) {
var that=this;

that.NewMap.getLayers().forEach(function (lyr,index) {

if (lyr.get('id')==fatherid) {

var layersArray = that.NewMap.getLayers();
layersArray.insertAt(index-1,layer);
}
});
}
posted @ 2022-07-15 00:05  小林222  阅读(20)  评论(0)    收藏  举报