render method
Renders this object. Called by markerPainter
Implementation
@override
void render(UiRenderContext renderContext) {
MappointRelative relative = renderContext.projection.latLonToPixel(latLong).offset(renderContext.reference);
Offset offset = Offset(relative.dx, relative.dy);
// Draw the circle
renderContext.canvas.expose().drawCircle(offset, 20, _paint);
// Prepare the text
_textPainter.text = TextSpan(
text: _clusterText,
style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
);
_textPainter.layout();
// Center the text inside the circle
final textOffset = offset - Offset(_textPainter.width / 2, _textPainter.height / 2);
// Draw the text
_textPainter.paint(renderContext.canvas.expose(), textOffset);
}