On this page

Class ScrollZoomHandlerMaptiler

The ScrollZoomHandler allows the user to zoom the map by scrolling.

Hierarchy (View Summary)

Index

Constructors

Methods

  • Disables the "scroll to zoom" interaction.

    Returns void

    map.scrollZoom.disable();
    
  • This is used to indicate if the handler is currently active or not. In case a handler is active, it will block other handlers from getting the relevant events. There is an allow list of handlers that can be active at the same time, which is configured when adding a handler.

    Returns boolean

  • Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.

    Returns boolean

    true if the "scroll to zoom" interaction is enabled.

  • renderFrame is the only non-dom event. It is called during render frames and can be used to smooth camera changes (see scroll handler).

    Returns {
        around: Point;
        needsRenderFrame: boolean;
        noInertia: boolean;
        originalEvent: any;
        zoomDelta: number;
    }

  • reset can be called by the manager at any time and must reset everything to it's original state

    Returns void

  • Set the zoom rate of a mouse wheel

    Parameters

    • wheelZoomRate: number

      1/450 The rate used to scale mouse wheel movement to a zoom value.

    Returns void

    Slow down zoom of mouse wheel

    map.scrollZoom.setWheelZoomRate(1/600);
    
  • Set the zoom rate of a trackpad

    Parameters

    • zoomRate: number

      1/100 The rate used to scale trackpad movement to a zoom value.

    Returns void

    Speed up trackpad zoom

    map.scrollZoom.setZoomRate(1/25);
    
Was this helpful?
SDK JS
Reference
ScrollZoomHandler