RenderinstructionCaption class

Rendering instruction for text labels and captions on the map.

This class handles the rendering of text labels for POIs, area names, and other textual information. It supports positioning relative to symbols, font styling, stroke outlines, and collision detection for optimal label placement.

Key features:

  • Text positioning relative to symbols or standalone
  • Font family, size, and style customization
  • Text stroke outlines for better readability
  • Collision detection and label placement optimization
  • Support for both node (POI) and way (area) labeling
Inheritance
Implemented types

Constructors

RenderinstructionCaption(int level)
Creates a new caption rendering instruction for the specified drawing level.

Properties

boundary ↔ MapRectangle?
The boundary of this object in pixels relative to the center of the corresponding node or way. This is a cache and will be calculated by asking. Do NOT clone this.
getter/setter pairinherited
display MapDisplay
Display mode controlling when this instruction should be rendered.
getter/setter pairinherited
dy double
getter/setter pairinherited
fillColor int
For texts the fillColor is the inner color, whereas the strokeColor is the surrounding "frame" of the text
getter/setter pairinherited
fontFamily MapFontFamily
no setterinherited
fontSize double
no setterinherited
fontStyle MapFontStyle
no setterinherited
gap double
Gap distance between caption and associated symbol in pixels.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
level int
latefinalinherited
position MapPositioning
Positioning of the caption relative to its anchor point or symbol.
getter/setter pair
priority int
getter/setter pairinherited
rotateWithMap bool
if false (default) the symbol will always drawn in the same direction regardless of the map rotation. For example an exclamation symbol (!) will always have the dot points towards the bottom of the screen. If true the symbol rotates with the map.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale ↔ Scale
getter/setter pairinherited
serial int
finalinherited
strokeCap MapCap
no setterinherited
strokeColor int
no setterinherited
strokeDashArray List<double>?
no setterinherited
strokeJoin MapJoin
no setterinherited
strokeMinZoomLevel int
no setterinherited
strokeWidth double
no setterinherited
symbolBoundary ↔ MapRectangle?
Boundary rectangle of the associated symbol for relative positioning.
getter/setter pair
symbolId String?
Identifier of the symbol this caption is associated with.
getter/setter pair
textKey ↔ TextKey?
Text key defining which map feature attribute to display.
getter/setter pair

Methods

baseSrcMixinClone(BaseSrcMixin base) → void
inherited
baseSrcMixinScale(BaseSrcMixin base, int zoomlevel) → void
inherited
calculateBoundaryWithSymbol(MapPositioning pos, double fontWidth, double fontHeight) → MapRectangle
fillSrcMixinClone(FillSrcMixin base) → void
inherited
fillSrcMixinScale(FillSrcMixin base, int zoomlevel) → void
inherited
forZoomlevel(int zoomlevel, int level) RenderinstructionCaption
Creates a copy of itself with the data needed for the given zoomlevel. Note that this should only be called from Rendertheme and NOT from RenderthemeZoomlevel
override
getBoundary(RenderInfo<Renderinstruction> renderInfo) → MapRectangle
Returns the boundary of this object around the center of the area or the poi. If the boundary cannot determined exactly we need to estimate it. This method is used only if the renderinstruction adds itself to label or clash (see LayerContainer)
override
getEstimatedTextBoundary(String caption, double strokeWidth) → MapSize
inherited
getMaxTextWidth() double
inherited
getType() String
Returns the type identifier for this rendering instruction.
override
isFillTransparent() bool
inherited
isStrokeTransparent() bool
inherited
matchNode(LayerContainer layerContainer, NodeProperties nodeProperties) → void
Checks the nodeProperties and adds itself to the layerContainer if there is something to draw.
override
matchWay(LayerContainer layerContainer, WayProperties wayProperties) → void
Checks the wayProperties and adds itself to the layerContainer if there is something to draw.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(XmlElement rootElement) → void
renderinstructionScale(Renderinstruction base, int zoomlevel) → void
Scales rendering parameters based on zoom level and base instruction.
inherited
secondPass(SymbolSearcher symbolSearcher) → void
Captions needs to find their assigned symbol to correctly render themself around the symbol. After all rules has been created a second pass is executed where captions are able to find their assigned symbol.
override
setDy(double value) → void
inherited
setFillColorFromNumber(int color) → void
inherited
setFontFamily(MapFontFamily fontFamily) → void
inherited
setFontSize(double fontSize) → void
inherited
setFontStyle(MapFontStyle fontStyle) → void
inherited
setMaxFontSize(double maxFontSize) → void
inherited
setMaxTextWidth(double maxTextWidth) → void
inherited
setScaleFromValue(String value) → void
inherited
setStrokeCap(MapCap cap) → void
inherited
setStrokeColorFromNumber(int color) → void
inherited
setStrokeDashArray(List<double>? strokeDashArray) → void
inherited
setStrokeJoin(MapJoin join) → void
inherited
setStrokeMinZoomLevel(int strokeMinZoomLevel) → void
inherited
setStrokeWidth(double strokeWidth) → void
inherited
setTextMinZoomLevel(int textMinZoomLevel) → void
inherited
strokeSrcMixinClone(StrokeSrcMixin base) → void
inherited
strokeSrcMixinScale(StrokeSrcMixin base, int zoomlevel) → void
inherited
textSrcMixinClone(TextSrcMixin base) → void
inherited
textSrcMixinScale(TextSrcMixin base, int zoomlevel) → void
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

DEFAULT_GAP double
Default gap between text and associated symbols in pixels.
final