getZoomlevelRangeWay method

ZoomlevelRange? getZoomlevelRangeWay(
  1. Waypath waypath,
  2. 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? getZoomlevelRangeWay(Waypath waypath, List<Tag> tags) {
  bool isClosedWay = waypath.isClosedWay();
  ZoomlevelRange? result;
  rulesList.forEach((rule) {
    ZoomlevelRange? range = isClosedWay ? rule.getZoomlevelRangeClosedWay(tags) : rule.getZoomlevelRangeOpenWay(tags);
    if (range != null) {
      if (result == null) {
        result = range;
      } else {
        result = result!.widenTo(range);
      }
    }
  });
  return result;
}