import type ol_Collection from 'ol/Collection' import type { Style, Text } from 'ol/style' import type { StyleFunction, StyleLike } from 'ol/style/Style' import type { Size } from 'ol/size' import type Layer from 'ol/layer/Layer' import type ol_legend_Image from './Image' import type ol_legend_Item from './Item' import type { olLegendItemOptions } from './Item' import BaseObject from 'ol/Object'; export interface Options { title?: string; maxWidth?: number; size?: Size; margin?: number; layer?: Layer; textStyle?: Text; titleStyle?: Text; style?: StyleLike; } /** Legend class to draw features in a legend element * @constructor * @fires select * @fires refresh */ export default class ol_legend_Legend extends BaseObject { /** Get a symbol image for a given legend item * @param {olLegendItemOptions} item * @param {Canvas|undefined} canvas a canvas to draw in, if none creat one * @param {int|undefined} offsetY Y offset to draw in canvas, default 0 */ static getLegendImage(item: olLegendItemOptions, canvas?: HTMLCanvasElement | undefined, row?: number): HTMLCanvasElement; /** * @param {*} options * @param {String} options.title Legend title * @param {number} [options.maxWidth] maximum legend width * @param {ol.size} [options.size] Size of the symboles in the legend, default [40, 25] * @param {number} [options.margin=10] Size of the symbole's margin, default 10 * @param { ol.layer.Base } [layer] layer associated with the legend * @param { ol.style.Text} [options.textStyle='16px sans-serif'] a text style for the legend, default 16px sans-serif * @param { ol.style.Text} [options.titleStyle='bold 16px sans-serif'] a text style for the legend title, default textStyle + bold * @param { ol.style.Style | Array