diff --git a/examples/layer-spy.html b/examples/layer-spy.html new file mode 100644 index 0000000000..4c2a97632d --- /dev/null +++ b/examples/layer-spy.html @@ -0,0 +1,60 @@ + + +
+ + + + + + + +View a portion of one layer over another
+
+ Layer rendering can be manipulated in precompose and postcompose event listeners.
+ These listeners get an event with a reference to the Canvas rendering context.
+ In this example, the precompose listener sets a clipping mask around the most
+ recent mouse position, giving you a spyglass effect for viewing one layer over another.
+
+ Move around the map to see the effect. Use the ↑ up and ↓ down arrow keys to adjust the spyglass size. +
+See the layer-spy.js source to see how this is done.
+