281
// add new markers
282
if (isNonEmptyArray(data)) {
284
>
// group by resource
285
>
const groups = new ResourceMap<IMarker[]>();
286
>
for (const { resource, marker: markerData } of data) {
287
>
const marker = MarkerService._toMarker(owner, resource, markerData);
288
>
if (!marker) {
289
// filter bad markers
290
continue;
291
}
293
>
if (!array) {
294
>
groups.set(resource, [marker]);
295
>
changes.push(resource);
296
>
} else {
297
array.push(marker);
298
}
300
>
301
>
// insert all
302
>
for (const [resource, value] of groups) {
303
>
this._data.set(resource, owner, value);
304
>
}
305
>
}
306
307
if (changes.length > 0) {