---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/examples/cases/behaviors.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/examples/cases/behaviors.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# Map behavior

<iframe id="LIVE-EXAMPLE" style="width:100%;height: 400px;border-radius: 8px;border: 1px solid rgba(92, 94, 102, 0.14);" frameBorder="0" src="https://yastatic.net/s3/front-maps-static/maps-front-jsapi-v2-1/examples/2/out/s3-cases/en/behaviors/index.html" allow="fullscreen"></iframe>

<a target="_blank" rel="noopener noreferrer" style="display: inline-block;margin-top: 10px;cursor: pointer;border-radius: 4px;padding: 9px 12px;background: #151515;color: white;text-decoration: none;font-weight: 500" href="https://codesandbox.io/p/sandbox/96d5lh?file=index.html">Open in CodeSandbox</a>

<div id="references">
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ready">ready</a>, <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map">Map</a>
</div>
<p>
    Interaction between the map and the user is programmed using
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/dg/concepts/map#behaviors">behaviors</a>.

</p>
<p>
    The map behaviors are controlled by the  <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.behavior.Manager">behaviors manager</a>.
    <strong>You should not have to create instances of this class</strong>.
     A reference to the behaviors manager is in the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map#behaviors">behaviors</a>
     field of the map object.
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html>
        <head>
            <title>Examples. Map behaviors</title>
            <meta
                http-equiv="Content-Type"
                content="text/html; charset=UTF-8"
            />
            <!--
            Set your own API-key. Testing key is not valid for other web-sites and services.
            Get your API-key on the Developer Dashboard: https://developer.tech.yandex.ru/keys/
        -->
            
            
            
        </head>
        <body>
            <div id="map"></div>
        </body>
    </html>
    ```

-   behaviors.js

    ```js
    var myMap;

    ymaps.ready(init);

    function init() {
        myMap = new ymaps.Map(
            "map",
            {
                // St. Petersburg
                center: [59.93772, 30.313622],
                zoom: 10,
            },
            {
                searchControlProvider: "yandex#search",
            }
        );

        myMap.behaviors
            /**
             * Disabling some of the behaviors enabled by default:
             * - drag - moving the map while holding down the left mouse button;
             * - magnifier.rightButton - zooming in on the area selected with the right mouse button.
             */
            .disable(["drag", "rightMouseButtonMagnifier"])
            // Enabling the ruler.
            .enable("ruler");

        /**
         * Using options to change the property of a behavior:
         * zooming with the scroll wheel will be slow,
         * 1/2 zoom level per second.
         */
        myMap.options.set("scrollZoomSpeed", 0.5);
    }
    ```

{% endlist %}
