P
P
photosho2022-02-14 12:23:44
API
photosho, 2022-02-14 12:23:44

How to find a cluster by object ID?

Tell me how to find the cluster in which the object is located, by the ID of this object? Automatic clustering:

objectManager = new ymaps.ObjectManager({
  clusterize: true,
  gridSize: 32,
  clusterDisableClickZoom: true
});

objectManager.objects.options.set('preset', 'islands#redDotIcon');
objectManager.clusters.options.set('preset', 'islands#redClusterIcons');
objectManager.add(placemarks);


You need to change the color of the cluster in which the object with a certain ID is located. I change the color of the object itself like this:

objectManager.objects.setObjectOptions(id, {preset: 'islands#blueDotIcon'});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question