restrictTo method

ZoomlevelRange restrictTo(
  1. ZoomlevelRange range
)

Returns a new ZoomlevelRange which is equal or smaller than the current one.

Implementation

ZoomlevelRange restrictTo(ZoomlevelRange range) {
  return ZoomlevelRange(Math.max(range.zoomlevelMin, zoomlevelMin),
      Math.min(range.zoomlevelMax, zoomlevelMax));
}