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

# Adding objects with different geometries to the map.

<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_spatial/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/v4j2rx?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 ObjectManager are located in the ObjectManager.objects collection. The visual representation of placemarks and clusters
    are objects that implement the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IOverlay">IOverlay</a> interface.
    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 lang="en">
        <head>
            <title>
                Examples. Adding objects with different geometries to the map.
            </title>
            <meta 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" class="map"></div>
        </body>
    </html>
    ```

-   object_manager_spatial.js

    ```js
    ymaps.ready(function () {
        var map = new ymaps.Map("map", {
                center: [55.79, 37.64],
                zoom: 10,
                controls: ["zoomControl"],
            }),
            objectManager = new ymaps.ObjectManager();

        // Loading a GeoJSON file with object descriptions.
        $.getJSON("data.json").done(function (geoJson) {
            // Adding JSON object descriptions to the object manager.
            objectManager.add(geoJson);
            // Adding objects to the map.
            map.geoObjects.add(objectManager);
        });
    });
    ```

{% endlist %}
