P
P
PendalF892018-08-13 10:03:29
Yandex maps
PendalF89, 2018-08-13 10:03:29

How to make a cluster diagram together with remoteObjectManager?

Hello!
I want to display cluster labels in the form of a chart. I do it like this:
JS:

var remoteObjectManager = new ymaps.RemoteObjectManager(url, {
    splitRequests: false,
    clusterHasBalloon: true,
    clusterHasHint: false,
    clusterIconLayout: 'default#pieChart',
    clusterIconPieChartRadius: 25,
    clusterIconPieChartCoreRadius: 10,
    clusterIconPieChartStrokeWidth: 3,
});

The FeatureCollection element coming from the server:
$item['id']                           = 1;
$item['type']                         = 'Cluster';
$item['number']                       = 10;
$item['bbox']                         = // ...;
$item['properties']['balloonContent'] = '';
$item['geometry']['type']           = 'Point';
$item['geometry']['coordinates'][0] = (float) $cluster['lat'];
$item['geometry']['coordinates'][1] = (float) $cluster['lng'];

How should information be sent from the server to form a chart?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PendalF89, 2018-08-13
@PendalF89

Understood. In php you need to add:

$item['properties']['data'] = [
  ['weight' => 5, 'color' => '#224080'],
  ['weight' => 3, 'color' => '#408022'],
  ['weight' => 2, 'color' => '#802240'],
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question