Skip to main content

Cooperative gestures

Enable cooperative gestures with a specific language. See how it behaves in fullscreen mode.

<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <link rel="stylesheet" href="https://maps-sdk.trimblemaps.com/v4/trimblemaps-4.2.3.css" />
        <script src="https://maps-sdk.trimblemaps.com/v4/trimblemaps-4.2.3.js"></script>
        <style>
            body { margin: 0; padding: 0; }
            html,body,#map {
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div id="map"></div>
        <script>
            TrimbleMaps.setAPIKey('YOUR_API_KEY_HERE');
        const map = new TrimbleMaps.Map({
        container: 'map',
        style: TrimbleMaps.Common.Style.TRANSPORTATION,
        center: [-74.5, 40],
        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.',
        },
        zoom: 4
    });
    map.addControl(new TrimbleMaps.FullscreenControl());
    </script>
  </body>
</html>
Last updated June 26, 2025.