Documentation
Reference
2.1.50 (current version)
collection
interactivityModel
Interfaces
2.1.51 (release candidate)
collection
interactivityModel
Interfaces

LoadingObjectManager

LoadingObjectManager lets you manage a large number of objects on the map. You can use it to add thousands of objects to the map, filter them, and clusterize them. In contrast to ObjectManager, LoadingObjectManager downloads data from the server itself. The manager only loads necessary data, which minimizes the volume of traffic.

Note. LoadingObjectManager doesn't allow dragging objects (it doesn't support the draggable option). It also doesn't support object editing.

Similar to ObjectManager, LoadingObjectManager is a layer containing a description of objects in JSON format. The description must contain coordinates and object IDs
[no-highlight[

The ID uniquely identifies each object of the manager. You can use the ID to get access to the desired object and, for example, change its options. Object IDs are required attributes and must be created independently.

]no-highlight]
, as well as information about their geometries. It can also specify additional information about the objects being added, such as their balloon contents.

Example of a JSON description of objects
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": 0,
      "geometry": {
        "type": "Point",
        "coordinates": [55.831903, 37.411961]
      },
      "properties": {
        "balloonContent": "Balloon content",
        "clusterCaption": "Placemark 1",
        "hintContent": "Hint text"
      }
    },
    {
      "type": "Feature",
      "id": 1,
      "geometry": {
        "type": "Point",
        "coordinates": [55.763338, 37.565466]
      },
      "properties": {
        "balloonContent": "Balloon content",
        "clusterCaption": "Placemark 2",
        "hintContent": "Hint text"
      }
    }
  ]
}

The ID uniquely identifies each object of the manager. You can use the ID to get access to the desired object and, for example, change its options. Object IDs are required attributes and must be created independently.

This is how LoadingObjectManager works: When creating the manager, the developer specifies the URL template that the manager will use for forming requests to the server to get necessary data. The manager loads object data only for the tiles that fall within the map viewport. However, data is loaded for the entire tile, even if a given tile does not completely fall within the viewport.

The manager stores the downloaded data on the client side. When the user moves the map or changes the zoom, the manager checks whether the data has been loaded for the new viewport area, and loads it from the server if necessary.

The manager and server exchange data in JSONP format. This means that the server must return data wrapped in a callback function. The developer needs to ensure that the server processes the requests coming from the client side and returns data in the required format.

Based on the downloaded data, LoadingObjectManager creates overlays, which it then adds to the map. Overlays are visual representations of objects on the map. Processing them requires fewer resources than processing geo objects (instances of the GeoObject class). The manager only creates overlays for the objects that fall within the map viewport.

Before beginning frontend development (creating a manager, setting object visibility, and so on), the developer should design the architecture of the server backend. The section Developing the frontend explains some of the features of the manager that should be taken into account when implementing the backend. This section also contains recommendations for storing data on the server side.