MinMaxZoomPreference constructor

const MinMaxZoomPreference(
  1. double minZoom,
  2. double maxZoom
)

为地图创建一个不可变的最大最小缩放范围

缩放级别范围为3, 20,超出范围取边界值

Implementation

const MinMaxZoomPreference(double minZoom, double maxZoom)
    : this.minZoom =
          ((minZoom < 3 ? 3 : minZoom) > (maxZoom > 20 ? 20 : maxZoom)
              ? maxZoom
              : minZoom),
      this.maxZoom =
          ((minZoom < 3 ? 3 : minZoom) > (maxZoom > 20 ? 20 : maxZoom)
              ? minZoom
              : maxZoom);