matchNode method

List<RenderInstruction> matchNode(
  1. Tile tile,
  2. PointOfInterest poi
)

Matches a node with the given parameters against this RenderTheme.

@param renderCallback the callback implementation which will be executed on each match. @param renderContext @param poi the point of interest.

Implementation

List<RenderInstruction> matchNode(final Tile tile, PointOfInterest poi) {
  MatchingCacheKey matchingCacheKey = new MatchingCacheKey(
      poi.tags, tile.zoomLevel, tile.indoorLevel, Closed.NO);

  List<RenderInstruction>? matchingList =
      this.poiMatchingCache[matchingCacheKey];
  if (matchingList == null) {
    // build cache
    matchingList = [];

    rulesList.forEach((element) {
      element.matchNode(tile, matchingList!, poi);
    });
    this.poiMatchingCache[matchingCacheKey] = matchingList;
  }
  return matchingList;
}