add method
void
add(
- T item,
- MapRectangle boundary
Adds a render item to the spatial index.
The item is added to all grid cells that intersect with its boundary. Items without boundaries are ignored for performance.
item Render item to add to the index
Implementation
void add(T item, MapRectangle boundary) {
final cells = _getCells(boundary);
for (final cell in cells) {
_grid.putIfAbsent(cell, () => <T>[]).add(item);
}
}