renderWay method

  1. @override
void renderWay(
  1. RenderInfo<Renderinstruction> renderInfo,
  2. RenderContext renderContext,
  3. WayProperties wayProperties
)

Renders a rectangle for a way.

Implementation

@override
void renderWay(RenderInfo renderInfo, RenderContext renderContext, WayProperties wayProperties) {
  if (renderContext is! UiRenderContext) throw Exception("renderContext is not UiRenderContext ${renderContext.runtimeType}");
  MapRectangle rectangle = wayProperties.getBoundaryAbsolute().offset(renderContext.reference);
  UiRect rect = UiRect(rectangle.left, rectangle.top, rectangle.right, rectangle.bottom);
  if (fill != null) renderContext.canvas.drawRect(rect, fill!);
  if (stroke != null) renderContext.canvas.drawRect(rect, stroke!);
}