getZoomlevelRangeClosedWay method

ZoomlevelRange? getZoomlevelRangeClosedWay(
  1. List<Tag> tags
)

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

Implementation

ZoomlevelRange? getZoomlevelRangeClosedWay(List<Tag> tags) {
  if (!matchesForZoomlevelRange(tags)) return null;

  bool supported = instructions.hasInstructionsClosedWays();
  // this rule supports the argument. Return this subrule which is the
  // widest subrule which supports the argument
  if (supported) {
    return zoomlevelRange;
  }
  ZoomlevelRange? result;
  subRules.forEach((element) {
    ZoomlevelRange? range = element.getZoomlevelRangeClosedWay(tags);
    if (range != null) {
      if (result == null) {
        result = range;
      } else {
        result = result!.widenTo(range);
      }
    }
  });
  return result;
}