@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
43 lines (42 loc) • 1.55 kB
TypeScript
import TileLayer from 'ol/layer/Tile.js';
import WMTS from 'ol/source/WMTS.js';
import ServerOgc from '../models/serverogc.js';
declare class LegendHelper {
/**
* Get the WMS legend URL.
* @param serverOgc The base url of the wms service.
* @param layerName The name of a wms layer.
* @param options to create the legend url.
* @returns The legend URL or undefined.
*/
static readonly getWMSLegendURL: (serverOgc: ServerOgc, layerName: string, options?: WMSLegendURLOptions) => string | undefined;
/**
* Retrieves the legend URL for a given WMTS tile layer.
* @param {TileLayer<WMTS>} olayer - The OpenLayers tile layer object.
* @returns The legend URL or undefined if not found.
*/
static readonly getWMTSLegendURL: (olayer: TileLayer<WMTS>) => string | undefined;
}
/**
* Options to get WMS legend URL.
* @property legendRule parameters to add to the returned URL.
* @property legendWidth the legend width.
* @property legendHeight the legend height.
* @property serverType the OpenLayers server type.
* @property dpi the DPI.
* @property bbox the bbox.
* @property srs The projection code.
* @property additionalQueryString Additional query string parameters.
*/
export interface WMSLegendURLOptions {
scale?: number;
legendRule?: string;
legendWidth?: number;
legendHeight?: number;
serverType?: string;
dpi?: number;
bbox?: number[];
srs?: string;
additionalQueryString?: Record<string, unknown>;
}
export default LegendHelper;