geostyler-openlayers-parser
Version:
GeoStyler Style Parser implementation for OpenLayers styles
32 lines (31 loc) • 1.51 kB
TypeScript
import { MarkSymbolizer } from 'geostyler-style';
export declare const LINE_WELLKNOWNNAMES: string[];
export declare const NOFILL_WELLKNOWNNAMES: string[];
export type svgDefinition = Record<string, string>;
export declare const getEncodedSvg: (svgString: string) => string;
export declare const getDecodedSvg: (svgEncodedString: string) => string;
export declare const getStyleComponents: (styleString: string) => Record<string, string>;
/**
* Extracts the properties of an SVG string into a GeoStyler-Style MarkSymbolizer.
*
* @param svgString the SVG string to parse
* @returns a GeoStyler-Style MarkSymbolizer
*/
export declare const getSvgProperties: (svgString: string) => MarkSymbolizer | undefined;
export declare const drawSvgToCanvas: (svgString: string, tmpContext: CanvasRenderingContext2D, canvasSize: number, rotation: number) => void;
/**
* Get the SVG sizes for a point symbolizer. Currently assumes square SVGs.
* @param radius The radius of the symbol in px
* @param strokeWidth The stroke width of the symbol in px
* @param unpaddedSizeSimpleV The unpadded size of the symbol in ViewBox units
* @returns An object containing the calculated SVG sizes
*/
export declare const getSvgSizes: (radius: number, strokeWidth: number, unpaddedSizeSimpleV: number) => {
minV: number;
sizeV: number;
heightPx: number;
};
export declare const getSizesFromSvg: (widthPx: number, strokeWidthV: number, viewBox: string) => {
radius: number;
strokeWidth: number | undefined;
};