MarkupRenderer
-
class
Markup.
MarkupRenderer
() This class provides an interface for MarkupItems to draw on the canvas.
Methods
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 - circle (
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] - circles (
drawLine
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] - lines (
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 - polygon (
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] - polygons (
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 - polyline (
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] - polylines (
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 - rectangle (
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] - rectangles (
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 - text (
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] - textBox (
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]] - textBoxes (
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] - texts (
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 - str (