---
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.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/examples/cases/object_manager.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# Adding objects to the map via 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/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/myt994?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.ObjectCollection">objectManager.ObjectCollection</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.ClusterCollection">objectManager.ClusterCollection</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/objectManager.OverlayCollection">objectManager.OverlayCollection</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 and add them to the map individually.
</p>
<p>
    The objects added to the ObjectManager are located in the ObjectManager.objects collection. Clusters formed from the
    added placemarks are added to the ObjectManager.clusters collection.
    The visual representation of placemarks is created asynchronously on demand. The visual representation of placemarks and clusters are objects implementing the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOverlay">IOverlay</a> interface. In particular, <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/overlay.Placemark">overlay.Placemark</a>.
    Overlays are placed in the ObjectManager.objects.overlays and ObjectManager.clusters.overlays collections, respectively.
</p>
<p>
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ObjectManager">ObjectManager</a>accepts placemark descriptions in JSON format. Placemarks can be clustered or shown as-is.
    If you don't use clusterization, the placemarks will be shown only in the visible map area.
    Since objects are stored in the manager as JSON descriptions and their visual representation is created only when necessary,
    this method of adding points to the map works faster than adding placemarks to the map directly or via the clusterer.
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html>
        <head>
            <title>Examples. Adding a large number of objects to the map</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.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({
                // Setting an option to make placemarks start clusterizing.
                clusterize: true,
                // ObjectManager accepts the same options as the clusterer.
                gridSize: 32,
                clusterDisableClickZoom: true,
            });

        /**
         * To set options for single objects and clusters,
         * we refer to child collections of ObjectManager.
         */
        objectManager.objects.options.set("preset", "islands#greenDotIcon");
        objectManager.clusters.options.set(
            "preset",
            "islands#greenClusterIcons"
        );
        myMap.geoObjects.add(objectManager);

        $.ajax({
            url: "data.json",
        }).done(function (data) {
            objectManager.add(data);
        });
    }
    ```

{% endlist %}
