Options
All
  • Public
  • Public/Protected
  • All
Menu

A high-level canvas to draw text labels on a map. To enable painting, implement the paintLabel method on your FeaturePainter. Within this method, you can make one or more draw* calls on the LabelCanvas. Each such call will attempt to place a label on screen. However, this does not necessarily mean that every label will be visible on screen. Visibility of a label depends on styling properties such as label-priority, label-grouping and whether you want to avoid overlapping labels ("decluttering"). For more information on the behaviour of label placement, please refer to LabelStyle.

Hierarchy

  • LabelCanvas

Overview

Methods

drawLabel

  • Draw a HTML label on the map at the specified position. The html should be a text-string and should not contain dynamic content.

    Parameters

    • html: string | HTMLElement

      The HTML to place on the map. It may contain HTML markup and CSS styling properties.

    • shape: Shape

      The shape for which the label should be drawn.

    • labelStyle: PointLabelStyle

      An object containing labeling properties. Note that the padding property is not supported. Use CSS padding and margin properties to simulate padding.

    Returns void

drawLabelInPath

  • Draw a HTML label on the map inside the shape. The html should be a text-string and should not contain dynamic content.

    Parameters

    • html: string | HTMLElement

      The HTML to place on the map. It may contain HTML markup and CSS styling properties.

    • shape: Shape

      The shape along which the label should be drawn.

    • labelStyle: InPathLabelStyle

      an object containing labeling properties.

    Returns void

drawLabelOnPath

  • Draw a HTML label on the map along the specified shape. The html should be a text-string and should not contain dynamic content.

    Parameters

    • html: string | HTMLElement

      The HTML to place on the map. It may contain HTML markup and CSS styling properties.

    • shape: Shape

      The shape in which to place the label.

    • labelStyle: OnPathLabelStyle

      an object containing labeling properties.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method