B
B
boki2017-10-05 10:24:26
Yandex maps
boki, 2017-10-05 10:24:26

How to reduce ymaps cluster icon size?

Hello.
I use ObjectManager to display labels with clustering. It is not clear how to reduce the size (visually the icon itself) of the cluster. The ObjectManager description says that for Options

You can set all the options specified in the Clusterer description, except for the hasBalloon and hasHint options.
Options for clusters are specified with the cluster prefix.

The clusterer has a parameter
options.gridSize

hence I use it as clusterGridSize.
Why doesn't it work, what am I doing wrong?
new ymaps.ObjectManager({
    clusterize: true,
    clusterGridSize: 2, // не работает ни с каким значением
    geoObjectOpenBalloonOnClick: false
});

UPD : I think gridSize does not work due to the absence of this parameter in the geo object cluster. I found the option.icons parameter , which, judging by the description, is what I need.
An array describing the icons for the default cluster implementation. Description of the icon is an object with fields
href - link to the image;
size - array of two numbers - icon size in pixels;
...

But why should I specify href? I don't need a custom icon, I just want to resize the standard one. If there is an options.iconColor parameter , then why not options.iconSize ?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Popkov, 2020-06-01
@spdesign

To change the clusterer grid, use gridSize: 2 instead of clusterGridSize: 2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question