getZoomlevelRangeClosedWay method

ZoomlevelRange? getZoomlevelRangeClosedWay(
  1. TagCollection tags
)

Returns the widest possible zoomrange which may accept the given argument. Returns null if if the argument will never accepted.

Implementation

ZoomlevelRange? getZoomlevelRangeClosedWay(TagCollection tags) {
  if (!matchesTags(tags)) return null;

  if (renderinstructionClosedWays.isNotEmpty) return zoomlevelRange;

  ZoomlevelRange? result;
  for (var element in subRules) {
    ZoomlevelRange? range = element.getZoomlevelRangeClosedWay(tags);
    if (range != null) {
      result = result?.widenTo(range) ?? range;
    }
  }
  return result;
}