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:
@@ -375,3 +375,13 @@ ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers =
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.layer.LayerState} state1
|
||||
* @param {ol.layer.LayerState} state2
|
||||
* @return {number}
|
||||
*/
|
||||
ol.renderer.Map.sortByZIndex = function(state1, state2) {
|
||||
return state1.zIndex - state2.zIndex;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user