Rendertheme class

Main rendering theme engine that defines how map features are styled and drawn.

A RenderTheme processes styling rules to determine how ways, nodes, and other map features should be rendered at different zoom levels. It manages rule hierarchies, background colors, drawing levels, and zoom-dependent styling.

Key responsibilities:

  • Rule processing and matching for map features
  • Zoom level dependent styling management
  • Drawing layer organization and ordering
  • Background color and styling configuration
  • Performance optimization through caching

Constructors

Rendertheme({required int maxLevels, int? mapBackground, int? mapBackgroundOutside, required List<Rule> rulesList, bool? hasBackgroundOutside, StyleMenu? styleMenu})

Properties

baseStrokeWidth ↔ double
Base stroke width multiplier for all line rendering. Applied as a scaling factor to all stroke widths in the theme.
getter/setter pair
baseTextSize ↔ double
Base text size multiplier for all text rendering. Applied as a scaling factor to all font sizes in the theme.
getter/setter pair
closedWayMatchingCache ↔ Cache<ITagCollection, ZoomlevelRange>
LRU cache for closed way (area) rendering instruction matches.
latefinal
forHash ↔ String
Hash string used for theme identification and caching.
latefinal
hasBackgroundOutside → bool?
Whether the theme defines a background color for areas outside the map.
final
hashCode → int
The hash code for this object.
no setterinherited
mapBackground → int?
Background color for the map area (ARGB format).
final
mapBackgroundOutside → int?
Background color for areas outside the map bounds (ARGB format).
final
maxLevels → int
Maximum number of drawing levels used by this theme. Higher levels are drawn on top of lower levels.
final
nodeMatchingCache ↔ Cache<ITagCollection, ZoomlevelRange>
LRU cache for node (POI) rendering instruction matches.
latefinal
openWayMatchingCache ↔ Cache<ITagCollection, ZoomlevelRange>
LRU cache for open way (linear) rendering instruction matches.
latefinal
rulesList → List<Rule>
Hierarchical list of styling rules for map feature rendering.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
styleMenu → StyleMenu?
final

Methods

complete() → void
Completes theme initialization by finalizing all rules.
dispose() → void
getLevels() → int
Returns the number of distinct drawing levels required by this theme.
getMapBackground() → int?
Returns the background color for the map area.
getMapBackgroundOutside() → int?
Returns the background color for areas outside the map bounds.
getZoomlevelRangeNode(ITagCollection tags) → ZoomlevelRange?
Returns the widest possible zoomrange which may accept the given argument. Returns null if the argument is never accepted.
getZoomlevelRangeWay(Waypath waypath, ITagCollection tags) → ZoomlevelRange?
Returns the widest possible zoomrange which may accept the given argument. Returns null if if the argument will never accepted.
hasMapBackgroundOutside() → bool?
Returns true if a background color is defined for areas outside the map.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareZoomlevel(int zoomlevel) → RenderthemeZoomlevel
Prepares and caches zoom level specific rendering rules.
setCategories(Set<String>? categories) → void
Sets the categories used for rendering. Rules can have a category parameter. When a list of categories is set with this method rules which do not match the categories will not be rendered. See also https://github.com/mapsforge/mapsforge/blob/master/docs/Rendertheme.md#stylemenus
toString() → String
A string representation of this object.
inherited
traverseRules(RuleVisitor visitor) → void
Traverses all rules in the theme using the visitor pattern.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

MATCHING_CACHE_SIZE → int
Size of the matching cache for performance optimization.
final