getZoomlevelRangeOpenWay method

ZoomlevelRange? getZoomlevelRangeOpenWay(
  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? getZoomlevelRangeOpenWay(List<Tag> tags) {
  if (!matchesForZoomlevelRange(tags)) return null;

  bool supported = instructions.hasInstructionsOpenWays();
  // 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.getZoomlevelRangeOpenWay(tags);
    if (range != null) {
      if (result == null) {
        result = range;
      } else {
        result = result!.widenTo(range);
      }
    }
  });
  return result;
}