Fix magnify example using right postrender events

This commit is contained in:
Florent gravin
2018-11-16 09:56:42 +01:00
committed by Tim Schaub
parent 3cba5ffbe2
commit c5b7c5febb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ layout: example.html
title: Magnify title: Magnify
shortdesc: Show a magnified version of imager under the pointer shortdesc: Show a magnified version of imager under the pointer
docs: > docs: >
<p>This example makes use of the <code>postcompose</code> event listener to <p>This example makes use of the <code>postrender</code> event listener to
oversample imagery in a circle around the pointer location. Listeners for this event have access to the Canvas context and can manipulate image data.</p> oversample imagery in a circle around the pointer location. Listeners for this event have access to the Canvas context and can manipulate image data.</p>
<p>Move around the map to see the effect. Use the ↑ up and ↓ down arrow keys to adjust the magnified circle size.</p> <p>Move around the map to see the effect. Use the ↑ up and ↓ down arrow keys to adjust the magnified circle size.</p>
tags: "magnify, image manipulation" tags: "magnify, image manipulation"
+1 -1
View File
@@ -48,7 +48,7 @@ container.addEventListener('mouseout', function() {
}); });
// after rendering the layer, show an oversampled version around the pointer // after rendering the layer, show an oversampled version around the pointer
imagery.on('postcompose', function(event) { imagery.on('postrender', function(event) {
if (mousePosition) { if (mousePosition) {
const context = event.context; const context = event.context;
const pixelRatio = event.frameState.pixelRatio; const pixelRatio = event.frameState.pixelRatio;