ymaps-pie-chart-clusterer icon indicating copy to clipboard operation
ymaps-pie-chart-clusterer copied to clipboard

How to dynamicly update cluster canvas?

Open de-soul opened this issue 9 years ago • 3 comments

Hello! Thank You for the extention ! In my case, i set clusterer placemarks options programmatically (myClustererPlacemark.options.set('preset','anotherColor'), for example), but if i look on the map, i cant see any changes on cluster canvas (pie-chart colors).

Then, i zoom into cluster and zoom out, and i see correct colors on the cluster pie chart. How to dynamically refresh cluster pie chart colors without user inputs on screen?

Help :(

de-soul avatar Nov 10 '15 13:11 de-soul

@de-soul I solved this like

$scope.updateClusters = function () {
    $scope.map.setZoom($scope.map.getZoom() + 1);
    $scope.map.setZoom($scope.map.getZoom() - 1);
};

georgy7 avatar Nov 08 '16 11:11 georgy7

+1 for this issue. Having the same problem.

sinedsem avatar Oct 21 '17 10:10 sinedsem

Solution provided by Yandex:

this.objectManager.clusters.overlays.getAll().forEach(l => {
    l.getIconLayout().then(s => s.rebuild());
});

sinedsem avatar Oct 21 '17 18:10 sinedsem