matchClosedWay method

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

Matches a closed way (area) against the rendering rules for this zoom level.

Uses cached results when available to improve performance. Closed ways represent areas such as buildings, parks, or water bodies.

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

Implementation

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

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

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