getZoomFromMaxVisibleTile function
double
getZoomFromMaxVisibleTile(
- BuildContext context,
- double tileSize,
- int maxTile, {
- Orientation? orientation,
Implementation
double getZoomFromMaxVisibleTile(
BuildContext context,
double tileSize,
int maxTile, {
Orientation? orientation,
}) {
final screenSize = MediaQuery.of(context).size;
if (screenSize == Size.zero || screenSize == Size.infinite) {
return 1;
}
double maxSize = 0;
switch (orientation) {
case Orientation.portrait:
maxSize = screenSize.height;
break;
case Orientation.landscape:
maxSize = screenSize.width;
break;
default:
maxSize = max(screenSize.width, screenSize.height);
}
return maxSize / (tileSize * maxTile);
}