---
title: "DragRotateHandler | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Class DragRotateHandler

The `DragRotateHandler` allows the user to rotate the map by clicking and dragging the cursor while holding the right mouse button or `ctrl` key.

##### Index

### Constructors[](#constructors)

[constructor](#constructor)

### Methods[](#methods)

[disable](#disable) [enable](#enable) [isActive](#isactive) [isEnabled](#isenabled)

## Constructors[](#constructors-1)

### constructor[](#constructor)

-   new DragRotateHandler(  
        options: [DragRotateHandlerOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.DragRotateHandlerOptions/),  
        mouseRotate: [MouseRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MouseRotateHandler/),  
        mousePitch: [MousePitchHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MousePitchHandler/),  
        mouseRoll: [MouseRollHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MouseRollHandler/),  
    ): DragRotateHandler[](#constructordragrotatehandler)
    
    #### Parameters
    
    -   options: [DragRotateHandlerOptions](https://docs.maptiler.com/sdk-js/api-reference/types/Externals.DragRotateHandlerOptions/)
    -   mouseRotate: [MouseRotateHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MouseRotateHandler/)
    -   mousePitch: [MousePitchHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MousePitchHandler/)
    -   mouseRoll: [MouseRollHandler](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.MouseRollHandler/)
    
    #### Returns DragRotateHandler
    
    #### Internal[](#internal)
    

## Methods[](#methods-1)

### disable[](#disable)

-   disable(): void[](#disable-1)
    
    Disables the "drag to rotate" interaction.
    
    #### Returns void
    
    #### Example[](#example)
    
    ```typescript
    map.dragRotate.disable();
    ```
    

### enable[](#enable)

-   enable(): void[](#enable-1)
    
    Enables the "drag to rotate" interaction.
    
    #### Returns void
    
    #### Example[](#example-1)
    
    ```typescript
    map.dragRotate.enable();
    ```
    

### isActive[](#isactive)

-   isActive(): boolean[](#isactive-1)
    
    Returns a Boolean indicating whether the "drag to rotate" interaction is active, i.e. currently being used.
    
    #### Returns boolean
    
    `true` if the "drag to rotate" interaction is active.
    

### isEnabled[](#isenabled)

-   isEnabled(): boolean[](#isenabled-1)
    
    Returns a Boolean indicating whether the "drag to rotate" interaction is enabled.
    
    #### Returns boolean
    
    `true` if the "drag to rotate" interaction is enabled.
