Add Z-index to layers
This commit allows setting a z-index property on the layers and uses it in the canvas, WEBGL and DOM map renderers for ordering the layers before rendering. Default z-index is 0 for managed layers and 1000 for unmanaged ones. It allows always on bottom, always on top and more complex layer layouts.
This commit is contained in:
@@ -172,6 +172,7 @@ ol.layer.Layer.prototype.setMap = function(map) {
|
||||
map, ol.render.EventType.PRECOMPOSE, function(evt) {
|
||||
var layerState = this.getLayerState();
|
||||
layerState.managed = false;
|
||||
layerState.zIndex = Infinity;
|
||||
evt.frameState.layerStatesArray.push(layerState);
|
||||
evt.frameState.layerStates[goog.getUid(this)] = layerState;
|
||||
}, false, this);
|
||||
|
||||
Reference in New Issue
Block a user