MarkupRenderer

class Markup.MarkupRenderer()

This class provides an interface for MarkupItems to draw on the canvas.


Methods

drawCircle

MarkupRenderer.drawCircle(circle)
Arguments:
  • circle (Circle()) – the circle to draw.

Renders a circle to the markup layer.

Returns:SVG element for the circle. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawCircles

MarkupRenderer.drawCircles(circles)
Arguments:
  • circles (CircleCollection()) – the collection of circle to render.

Renders a collection of circles sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each circle. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawLine

MarkupRenderer.drawLine(line)
Arguments:
  • line (Line()) – the line to render.

Renders a line to the markup layer.

Returns:SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawLines

MarkupRenderer.drawLines(lines)
Arguments:
  • lines (LineCollection()) – the collection of lines to render.

Renders a collection of lines sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawPolygon

MarkupRenderer.drawPolygon(polygon)
Arguments:
  • polygon (Polygon()) – the polygon to render.

Renders a polygon to the markup layer.

Returns:SVG element for the polygon. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawPolygons

MarkupRenderer.drawPolygons(polygons)
Arguments:
  • polygons (PolygonCollection()) – the collection of polygons to render.

Renders a collection of polygons sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each polygon. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawPolyline

MarkupRenderer.drawPolyline(polyline)
Arguments:
  • polyline (Polyline()) – None

Renders a polyline to the markup layer.

Returns:SVG element for the line. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawPolylines

MarkupRenderer.drawPolylines(polylines)
Arguments:
  • polylines (PolylineCollection()) – None

Renders a collection of polylines sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each line. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawRectangle

MarkupRenderer.drawRectangle(rectangle)
Arguments:
  • rectangle (Rectangle()) – the rectangle to render.

Renders a rectangle to the markup layer.

Returns:SVG element for the rectangle. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawRectangles

MarkupRenderer.drawRectangles(rectangles)
Arguments:
  • rectangles (RectangleCollection()) – the collection of rectangles to render.

Renders a collection of rectangles sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each rectangle. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawText

MarkupRenderer.drawText(text)
Arguments:
  • text (Text()) – the text to render.

Renders text to the markup layer.

Returns:SVG element for the text. This element is temporary and will not be preserved when the markup is redrawn.
Return type:Element

drawTextBox

MarkupRenderer.drawTextBox(textBox)
Arguments:
  • textBox (TextBox()) – the text box to render.

Renders a text box to the markup layer.

Returns:SVG element pair for the text. The first item in this array corresponds to the rectangle. The second item corresponds to the text. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

drawTextBoxes

MarkupRenderer.drawTextBoxes(textBoxes)
Arguments:
  • textBoxes (TextBoxCollection()) – the collection of text boxes to render.

Renders a collection of text boxes sharing the same properties to the markup layer.

Returns:an array containing SVG element pairs for each text box. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[[Element]]

drawTexts

MarkupRenderer.drawTexts(texts)
Arguments:
  • texts (TextCollection()) – the collection of texts to render.

Renders a collection of text sharing the same properties to the markup layer.

Returns:an array containing SVG elements for each text. These elements are temporary and will not be preserved when the markup is redrawn.
Return type:[Element]

measureText

MarkupRenderer.measureText(str, markup)
Arguments:
  • str (string()) – the text string to measure.
  • markup (TextMarkupBase()) – None

Computes the width and height of a string using the given text attributes.

Returns:a point object containing the width and height in pixels of the string.
Return type:Point2

measureTextBox

MarkupRenderer.measureTextBox(textBox)
Arguments:
  • textBox (TextBox()) – the text box to measure.

Computes the width and height of a text box.

Returns:a point object containing the width and height in pixels of the text box.
Return type:Point2