restrictToMax method
Returns a new ZoomlevelRange where the maximum zoomlevel is either the given zoomlevel or the existing one - whichever is smaller.
Implementation
ZoomlevelRange restrictToMax(int max) {
return ZoomlevelRange(zoomlevelMin, Math.min(max, zoomlevelMax));
}