campusMapBuildingLabelScale function

double campusMapBuildingLabelScale(
  1. double zoom
)

Grows labels smoothly from half size at overview to full size at zoom 19.

Smoothstep eases both ends without reflowing text during fractional zooms.

Implementation

double campusMapBuildingLabelScale(double zoom) {
  if (zoom < campusMapBuildingLabelMinZoom) return 0;
  final progress = ((zoom - campusMapBuildingLabelMinZoom) / 2.5).clamp(
    0.0,
    1.0,
  );
  return 0.5 + 0.5 * progress * progress * (3 - 2 * progress);
}