Fix zIndex handling for unmanaged layers

This commit is contained in:
ahocevar
2019-05-05 13:16:28 +02:00
parent 6cfd0b70ed
commit ba6ac43a28
5 changed files with 17 additions and 11 deletions
+1 -6
View File
@@ -212,12 +212,7 @@ class Layer extends BaseLayer {
if (map) {
this.mapPrecomposeKey_ = listen(map, RenderEventType.PRECOMPOSE, function(evt) {
const renderEvent = /** @type {import("../render/Event.js").default} */ (evt);
const layerState = this.getLayerState();
layerState.managed = false;
if (this.getZIndex() === undefined) {
layerState.zIndex = Infinity;
}
renderEvent.frameState.layerStatesArray.push(layerState);
renderEvent.frameState.layerStatesArray.push(this.getLayerState(false));
}, this);
this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map);
this.changed();