ymaps.ready(() => {
let data = this.shipments;
let myMap = new ymaps.Map("map", {
center: [55.751574, 37.573856],
zoom: 9,
behaviors: ["default", "scrollZoom"]
},
{
searchControlProvider: "yandex#search"
}
);
let clusterer = new ymaps.Clusterer();
let geoObjects = [];
for (var i = 0, len = data.length; i < len; i++) {
geoObjects[i] = new ymaps.Placemark(data[i].location, {
iconCaption: data[i].ml + ', ' + data[i].orderId + ', ' + data[i].height + ', ' + data[i].weight,
id: i
});
}
clusterer.add(geoObjects);
myMap.geoObjects.add(clusterer);
clusterer.events.add('click', function (e) {
let id = e.get('target').properties._data.id;
if(id !== undefined) {
e.originalEvent.currentTarget.remove(geoObjects[id])
}
});
});
array('Content-Type: text/xml');