Class ScrollZoomHandler

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

Implements

Methods

  • Disables the "scroll to zoom" interaction.

    Returns void

    Example

    map.scrollZoom.disable();
    
  • Enables the "scroll to zoom" interaction.

    Parameters

    Returns void

    Example

    map.scrollZoom.enable();
    map.scrollZoom.enable({ around: 'center' })
  • Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.

    Returns boolean

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

  • 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

    Example

    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

    Example

    Speed up trackpad zoom

    map.scrollZoom.setZoomRate(1/25);