M
M
Maxim2015-11-19 13:07:42
Yandex
Maxim, 2015-11-19 13:07:42

Is it possible to change the cluster size, i.e. its diameter?

Is it possible to change the cluster size, i.e. its diameter ?
Screen

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-11-19
@healqq

Yes, it's possible. To do this, you need to set options.numbers and options.icons for icons.
Options.icons specifies the sizes of icons (you can also set custom icons there) Options.numbers specifies
the boundaries, when passing through which the size of the cluster changes. This array must contain one more value than the options.icons array . Example:

clusterer = new ymaps.Clusterer({
            // Зададим массив, описывающий иконки кластеров разного размера.
            clusterIcons: [{
                href: 'images/cat.png',
                size: [40, 40],
                offset: [-20, -20]
            },
            {
                href: 'images/cat.png',
                size: [80, 80],
                offset: [-40, -40]
            }],
            // Эта опция отвечает за размеры кластеров.
            // В данном случае для кластеров, содержащих до 100 элементов,
            // будет показываться маленькая иконка. Для остальных - большая.
            clusterNumbers: [10],
});

The example is taken from the Yandex maps sandbox and slightly modified. (There he is some kind of curve).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question