matchOpenWay method

List<Renderinstruction> matchOpenWay(
  1. Tile tile,
  2. Way way
)

Matches a linear way (open path) against the rendering rules for this zoom level.

Uses cached results when available to improve performance. Linear ways represent paths such as roads, rivers, or boundaries.

tile Tile context containing indoor level information way Linear way to match against rules Returns list of applicable rendering instructions

Implementation

List<Renderinstruction> matchOpenWay(final Tile tile, Way way) {
  MatchingCacheKey matchingCacheKey = MatchingCacheKey(way.tags, tile.indoorLevel);

  List<Renderinstruction>? matchingList = openWayMatchingCache[matchingCacheKey];
  if (matchingList == null) {
    // build cache
    matchingList = [];
    for (var rule in rulesList) {
      rule.matchOpenWay(way, tile, matchingList);
    }

    openWayMatchingCache[matchingCacheKey] = matchingList;
  }
  return matchingList;
}