Fix layer-spy example using right post/pre render events

This commit is contained in:
Florent gravin
2018-11-15 19:47:45 +01:00
committed by Tim Schaub
parent 358f58ba3a
commit 45cd573768

View File

@@ -52,7 +52,7 @@ container.addEventListener('mouseout', function() {
});
// before rendering the layer, do some clipping
imagery.on('precompose', function(event) {
imagery.on('prerender', function(event) {
const ctx = event.context;
const pixelRatio = event.frameState.pixelRatio;
ctx.save();
@@ -69,7 +69,7 @@ imagery.on('precompose', function(event) {
});
// after rendering the layer, restore the canvas context
imagery.on('postcompose', function(event) {
imagery.on('postrender', function(event) {
const ctx = event.context;
ctx.restore();
});