Fix layer-spy example using right post/pre render events
This commit is contained in:
committed by
Tim Schaub
parent
358f58ba3a
commit
45cd573768
@@ -52,7 +52,7 @@ container.addEventListener('mouseout', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// before rendering the layer, do some clipping
|
// before rendering the layer, do some clipping
|
||||||
imagery.on('precompose', function(event) {
|
imagery.on('prerender', function(event) {
|
||||||
const ctx = event.context;
|
const ctx = event.context;
|
||||||
const pixelRatio = event.frameState.pixelRatio;
|
const pixelRatio = event.frameState.pixelRatio;
|
||||||
ctx.save();
|
ctx.save();
|
||||||
@@ -69,7 +69,7 @@ imagery.on('precompose', function(event) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// after rendering the layer, restore the canvas context
|
// after rendering the layer, restore the canvas context
|
||||||
imagery.on('postcompose', function(event) {
|
imagery.on('postrender', function(event) {
|
||||||
const ctx = event.context;
|
const ctx = event.context;
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user