Measures the actual rendered size of a text label in pixels. Adding an actual element to the document is expensive, and since the measurement tool will always ask for dimensions of
one single fixed font family and size, we cache dimensions for each letter of a font in a dictionary for later reuse. This ensures only a limited number of page element additions
and removals no matter how many labels are measured (this may be a large number if we're measuring actual features on the map using layer actions).
Parameters
labelStr: string
The text label to measure label size for
fontFamily: string
The font family to be applied to the text
fontSize: string
layerId: string
Returns object
An object with the width and height of the speciified label
Measures the actual rendered size of a text label in pixels. Adding an actual element to the document is expensive, and since the measurement tool will always ask for dimensions of one single fixed font family and size, we cache dimensions for each letter of a font in a dictionary for later reuse. This ensures only a limited number of page element additions and removals no matter how many labels are measured (this may be a large number if we're measuring actual features on the map using layer actions).