Fix layer-clipping example using right postrender events

This commit is contained in:
Florent gravin
2018-11-16 10:37:42 +01:00
committed by Tim Schaub
parent f73c6fab35
commit 1dbe52d738

View File

@@ -16,7 +16,7 @@ const map = new Map({
})
});
osm.on('precompose', function(event) {
osm.on('prerender', function(event) {
const ctx = event.context;
ctx.save();
const pixelRatio = event.frameState.pixelRatio;
@@ -38,7 +38,7 @@ osm.on('precompose', function(event) {
ctx.translate(-size[0] / 2 * pixelRatio, -size[1] / 2 * pixelRatio);
});
osm.on('postcompose', function(event) {
osm.on('postrender', function(event) {
const ctx = event.context;
ctx.restore();
});