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

# Opening the balloon on the placemark in ObjectManager

<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/object_manager_balloon/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/54x6ph?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/ObjectManager">ObjectManager</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.Balloon">objectManager.Balloon</a>
</div>
<p>
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ObjectManager">ObjectManager</a> - A class for adding a large number of objects to the map
    without needing to create placemarks individually.
</p>
<p>
    Objects added in ObjectManager are in the ObjectManager.objects collection.
    The clusters formed from the added placemarks are added to the ObjectManager.clusters collection.
</p>
<p>
    These collections have managers that control balloons and hints (ObjectManager.objects.balloon, ObjectManager.clusters.hint).
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html>
        <head>
            <title>Examples. Working with the balloon in ObjectManager</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>
    ```

-   object_manager_balloon.js

    ```js
    ymaps.ready(init);

    function init() {
        var myMap = new ymaps.Map(
                "map",
                {
                    center: [55.76, 37.64],
                    zoom: 10,
                },
                {
                    searchControlProvider: "yandex#search",
                }
            ),
            objectManager = new ymaps.ObjectManager({
                clusterize: true,
            });

        myMap.geoObjects.add(objectManager);

        $.ajax({
            url: "data.json",
        }).done(function (data) {
            objectManager.add(data);
            // Opening the balloon on the placemark with id == 1.
            var objectState = objectManager.getObjectState(1);
            if (objectState.isClustered) {
                // Making sure that the specified object has been "selected" in the balloon.
                objectManager.clusters.state.set(
                    "activeObject",
                    objectManager.objects.getById(1)
                );
                /**
                 * All the generated clusters have unique identifiers.
                 * This identifier must be passed to the balloon manager to specify
                 * which cluster to show the balloon on.
                 */
                objectManager.clusters.balloon.open(objectState.cluster.id);
            } else {
                objectManager.objects.balloon.open(1);
            }
        });
    }
    ```

{% endlist %}
