How to apply the pan-and-zoom effect