rectangleTiles function
Implementation
List<Coords<num>> rectangleTiles(Map<String, dynamic> input) {
final LatLngBounds bounds = input['bounds'];
final int minZoom = input['minZoom'];
final int maxZoom = input['maxZoom'];
final Crs crs = input['crs'];
final CustomPoint<num> tileSize = input['tileSize'];
final List<Coords<num>> coords = [];
for (int zoomLvl = minZoom; zoomLvl <= maxZoom; zoomLvl++) {
final CustomPoint<num> nwCustomPoint = crs
.latLngToPoint(bounds.northWest, zoomLvl.toDouble())
.unscaleBy(tileSize)
.floor();
final CustomPoint<num> seCustomPoint = crs
.latLngToPoint(bounds.southEast, zoomLvl.toDouble())
.unscaleBy(tileSize)
.ceil() -
const CustomPoint(1, 1);
for (num x = nwCustomPoint.x; x <= seCustomPoint.x; x++) {
for (num y = nwCustomPoint.y; y <= seCustomPoint.y; y++) {
coords.add(Coords(x, y)..z = zoomLvl);
}
}
}
return coords;
}