Fix magnify example using right postrender events
This commit is contained in:
committed by
Tim Schaub
parent
3cba5ffbe2
commit
c5b7c5febb
@@ -3,7 +3,7 @@ layout: example.html
|
||||
title: Magnify
|
||||
shortdesc: Show a magnified version of imager under the pointer
|
||||
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>
|
||||
<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"
|
||||
|
||||
@@ -48,7 +48,7 @@ container.addEventListener('mouseout', function() {
|
||||
});
|
||||
|
||||
// after rendering the layer, show an oversampled version around the pointer
|
||||
imagery.on('postcompose', function(event) {
|
||||
imagery.on('postrender', function(event) {
|
||||
if (mousePosition) {
|
||||
const context = event.context;
|
||||
const pixelRatio = event.frameState.pixelRatio;
|
||||
|
||||
Reference in New Issue
Block a user