---
title: "Cooperative gestures | JavaScript maps SDK"
description: "Enable cooperative gestures with specific language support."
---

# Cooperative gestures

This example shows how to enable cooperative gestures with a specific language.

See how it behaves: on desktop, zoom using the mouse wheel. On mobile, touch and move the map.

Windows: Use Ctrl + scroll to zoom the map.

Mac: Use ⌘ + scroll to zoom the map.

Mobile: Use two fingers to move the map.

### NPM module setup

```bash
npm install --save @maptiler/sdk
```

#### main.js

```js
import { Map, MapStyle, config } from '@maptiler/sdk';
import '@maptiler/sdk/dist/maptiler-sdk.css';

config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
const map = new Map({
  container: 'map',
  style: MapStyle.STREETS,
  center: [-77.04, 38.907],
  zoom: 11.15,
  cooperativeGestures: true,
  locale: {
    'CooperativeGesturesHandler.WindowsHelpText': 'Utilice Ctrl + desplazamiento para hacer zoom en el mapa.',
    'CooperativeGesturesHandler.MacHelpText': 'Usa ⌘ + desplazamiento para hacer zoom en el mapa.',
    'CooperativeGesturesHandler.MobileHelpText': 'Usa dos dedos para mover el mapa.',
  },
});
```

#### index.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="robots" content="noindex">
  <title>Cooperative gestures | NPM example</title>
  <link rel="stylesheet" href="./style.css">
</head>
<body>
  <div id="map"></div>
  <script type="module" src="./main.js"></script>
</body>
</html>
```

#### style.css

```css
body {margin: 0; padding: 0;}
#map {position: absolute; top: 0; bottom: 0; width: 100%;}
```

### Basic JavaScript setup

```html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cooperative gestures</title>
<script src="https://cdn.maptiler.com/maptiler-sdk-js/v4.2.0/maptiler-sdk.umd.min.js"></script>
<link href="https://cdn.maptiler.com/maptiler-sdk-js/v4.2.0/maptiler-sdk.css" rel="stylesheet" />
<style>
  body {margin: 0; padding: 0;}
  #map {position: absolute; top: 0; bottom: 0; width: 100%;}
</style>
</head>
<body>
<div id="map"></div>

<script>
    maptilersdk.config.apiKey = 'YOUR_MAPTILER_API_KEY_HERE';
    const map = new maptilersdk.Map({
      container: 'map',
      style: maptilersdk.MapStyle.STREETS,
      center: [-77.04, 38.907],
      zoom: 11.15,
      cooperativeGestures: true,
      locale: {
        'CooperativeGesturesHandler.WindowsHelpText': 'Utilice Ctrl + desplazamiento para hacer zoom en el mapa.',
        'CooperativeGesturesHandler.MacHelpText': 'Usa ⌘ + desplazamiento para hacer zoom en el mapa.',
        'CooperativeGesturesHandler.MobileHelpText': 'Usa dos dedos para mover el mapa.',
      },
    });
</script>
</body>
</html>
```

## Related examples

### [Hide map navigation controls](https://docs.maptiler.com/sdk-js/examples/navigation/)

Tutorials

Hide the map navigation and zoom controls.

### [Create a non-interactive map](https://docs.maptiler.com/sdk-js/examples/interactive-false/)

Examples

Disable interactivity to create a static map.

### [Disable scroll zoom](https://docs.maptiler.com/sdk-js/examples/disable-scroll-zoom/)

Examples

Prevent scroll actions from zooming your interactive map.

### [Toggle interactions](https://docs.maptiler.com/sdk-js/examples/toggle-interaction-handlers/)

Examples

Enable or disable specific user interaction handlers on maps.
