S
S
sinneren2020-03-04 13:10:16
API
sinneren, 2020-03-04 13:10:16

How to inherit icon colors (placemark) in a cluster?

When creating a map, I set the cluster settings:

var geoObjectCollection = getGeoObjectCollection();

        clusterer = new ymaps.Clusterer();
        clusterer.add(geoObjectCollection);
        myMap.geoObjects.add(clusterer);


In getGeoObjectCollection I create points with my icons and content:
var placeMark = new ymaps.Placemark(
                [pickup.geo_lat, pickup.geo_lon],
                {
                    hintContent: pickup.title,
                    iconContent: mapIconContent,
                },
                {
                    iconLayout: 'default#imageWithContent',
                    iconImageHref: '/static/images/icon/map/outpost/' + mapIcon,
                    iconImageSize: [69, 79],
                    iconImageOffset: [-34, -39],
                    iconColor: '#FFEF00',
                    iconContentOffset: [10, 40],
                    iconContentSize: [49, 10],
                    iconContentLayout: MyIconContentLayout,
                }
            );


It was assumed that the iconColor option would affect the color of the cluster, it used to be done somehow, conducted the experiment, but now this does not happen, so how to make clusters of different colors right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sinneren, 2020-03-05
@sinneren

Set cluster type - PieChart

A
Alexander Cheremkhin, 2020-03-04
@Che603000

It looks like something is wrong with your options Specification: YMaps.Placemark(coordPoint, options)
And you have two objects.
https://tech.yandex.ru/maps/archive/doc/jsapi/1.x/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question