All examples By author By category About

phil-pedruco

Disable zoom on scrollwheel but retain the ability to pan #2

This is a follow up to this stack overflow question that aimed to restrict the scrollwheel zoom ability when using zoom behaviour. Two answers were proposed and this bl.ock together with the bl.ock here demonstrate these answers. The answer by Lars Kotthoff was be far the more elegant and the I'd recommend to use rather than my solution but both achieve the same thing. However, there was a comment that the performance of the second solution was laggy, I thought I'd create a demonstration.

This answer uses translate operator with the scale, but the scale is constrained using the scaleExtent operator.