matchNode method

List<Renderinstruction> matchNode(
  1. int indoorLevel,
  2. PointOfInterest pointOfInterest
)

Matches a node (POI) against the rendering rules for this zoom level.

Uses cached results when available to improve performance. The matching process considers both the POI's tags and the indoor level for 3D mapping.

indoorLevel Indoor level for 3D mapping support pointOfInterest Point of interest to match against rules Returns list of applicable rendering instructions

Implementation

List<Renderinstruction> matchNode(final int indoorLevel, PointOfInterest pointOfInterest) {
  MatchingCacheKey matchingCacheKey = MatchingCacheKey(pointOfInterest.tags, indoorLevel);

  List<Renderinstruction>? matchingList = nodeMatchingCache[matchingCacheKey];
  if (matchingList == null) {
    // build cache
    matchingList = [];

    for (var element in rulesList) {
      element.matchNode(indoorLevel, matchingList, pointOfInterest);
    }
    nodeMatchingCache[matchingCacheKey] = matchingList;
  }
  return matchingList;
}