/** * Calculate the area of the passed polygon and return a formatted string * of the area. * * @param {import('ol/geom/Polygon').default} polygon Polygon. * @param {import('ol/proj/Projection').default} projection Projection of the polygon coords. * @param {number|undefined} precision Precision. * @param {import('ngeo/misc/filters').unitPrefix} format The format function. * @param {boolean} [spherical=false] Whether to use the spherical area. * @returns {string} Formatted string of the area. * @hidden */ export function getFormattedArea(polygon: import("ol/geom/Polygon").default, projection: import("ol/proj/Projection").default, precision: number | undefined, format: import("ngeo/misc/filters").unitPrefix, spherical?: boolean): string; /** * Calculate the area of the passed circle and return a formatted string of the area. * * @param {import('ol/geom/Circle').default} circle Circle * @param {number|undefined} precision Precision. * @param {import('ngeo/misc/filters').unitPrefix} format The format function. * @returns {string} Formatted string of the area. * @hidden */ export function getFormattedCircleArea(circle: import("ol/geom/Circle").default, precision: number | undefined, format: import("ngeo/misc/filters").unitPrefix): string; /** * Calculate the length of the passed line string and return a formatted * string of the length. * * @param {import('ol/geom/LineString').default} lineString Line string. * @param {import('ol/proj/Projection').default} projection Projection of the line string coords. * @param {number|undefined} precision Precision. * @param {import('ngeo/misc/filters').unitPrefix} format The format function. * @param {boolean} [spherical=false] Whether to use the spherical distance. * @returns {string} Formatted string of length. * @hidden */ export function getFormattedLength(lineString: import("ol/geom/LineString").default, projection: import("ol/proj/Projection").default, precision: number | undefined, format: import("ngeo/misc/filters").unitPrefix, spherical?: boolean): string; /** * Return a formatted string of the point. * * @param {import('ol/geom/Point').default} point Point. * @param {number|undefined} decimals Decimals. * @param {import('ngeo/misc/filters').numberCoordinates} format A function to format coordinate into * text * @param {string} [opt_template] The template. * @returns {string} Formatted string of coordinate. * @hidden */ export function getFormattedPoint(point: import("ol/geom/Point").default, decimals: number | undefined, format: import("ngeo/misc/filters").numberCoordinates, opt_template?: string): string; /** * Handle map browser event. * * @param {import('ol/MapBrowserEvent').default} evt Map browser event. * @returns {boolean} `false` if event propagation should be stopped. * @private * @hidden * @this {Measure} */ export function handleEvent_(this: Measure, evt: import("ol/MapBrowserEvent").default): boolean; export default Measure; /** * Interactions for measure tools. */ export type MeasureOptions = { /** * Element including the message to display in the help tooltip when the user * just activated the interaction. */ startMsg?: Element; /** * Element including the message to display in the help tooltip when the * user already added the first point. */ continueMsg?: Element; /** * Defines the number of digits to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. */ precision?: number; /** * Defines the number of decimals to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. */ decimals?: number; /** * Defines the tolerance. */ tolerance?: number; /** * The style to be used when * drawing is finished. */ style?: import("ol/style/Style").StyleLike; /** * The style to be used * while drawing. */ sketchStyle?: import("ol/style/Style").StyleLike; /** * The source. */ source?: import("ol/source/Vector").default; }; export type MeasureEventItem = { feature: import("ol/Feature").default; }; export type MeasureEvent = import("ngeo/CustomEvent").default; /** * Interactions for measure tools. * * @typedef {Object} MeasureOptions * @property {Element} [startMsg] Element including the message to display in the help tooltip when the user * just activated the interaction. * @property {Element} [continueMsg] Element including the message to display in the help tooltip when the * user already added the first point. * @property {number} [precision] Defines the number of digits to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. * @property {number} [decimals] Defines the number of decimals to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. * @property {number} [tolerance] Defines the tolerance. * @property {import('ol/style/Style').StyleLike} [style] The style to be used when * drawing is finished. * @property {import('ol/style/Style').StyleLike} [sketchStyle] The style to be used * while drawing. * @property {import('ol/source/Vector').default} [source] The source. */ /** * @typedef {Object} MeasureEventItem * @property {import('ol/Feature').default} feature */ /** * @typedef {import('ngeo/CustomEvent').default} MeasureEvent */ /** * Interaction that allows measuring (length, area, ...). * * @private * @hidden */ declare class Measure extends olInteractionInteraction { /** * @param {import('ngeo/interaction/MeasureBaseOptions').MeasueBaseOptions} [options] Options */ constructor(options?: import("ngeo/interaction/MeasureBaseOptions").MeasueBaseOptions); /** * The help tooltip element. * * @type {?HTMLElement} */ helpTooltipElement_: HTMLElement | null; /** * Overlay to show the help messages. * * @type {?import('ol/Overlay').default} */ helpTooltipOverlay_: import("ol/Overlay").default | null; /** * The measure tooltip element. * * @type {?HTMLElement} * @private */ private measureTooltipElement_; /** * Overlay to show the measurement. * * @type {?import('ol/Overlay').default} * @private */ private measureTooltipOverlay_; /** * The measurement overlay coordinate. * * @type {?import('ol/coordinate').Coordinate} * @private */ private measureTooltipOverlayCoord_; /** * The sketch feature. * * @type {?import('ol/Feature').default} */ sketchFeature: import("ol/Feature").default | null; /** * Message to show after the first point is clicked. * * @type {?Element} */ continueMsg: Element | null; /** * Defines the number of decimals to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. * * @type {number|undefined} * @protected */ protected decimals: number | undefined; /** * Defines the number of precision to keep in the measurement. If not defined, * then the default behavior occurs depending on the measure type. * * @type {number|undefined} * @protected */ protected precision: number | undefined; /** * Whether or not to display any tooltip * * @type {boolean} */ displayHelpTooltip_: boolean; /** * The message to show when user is about to start drawing. * * @type {Element} */ startMsg: Element; /** * The key for geometry change event. * * @type {?import('ol/events').EventsKey} * @private */ private changeEventKey_; /** * The key for map postcompose event. * * @type {?import('ol/events').EventsKey} * @private */ private postcomposeEventKey_; /** * The vector layer used to show final measure features. * * @type {import('ol/layer/Vector').default>} * @private */ private vectorLayer_; /** * The draw interaction to be used. * * @type {import('ol/interaction/Draw').default|import('ngeo/interaction/DrawAzimut').default|import('ngeo/interaction/MobileDraw').default} * @private */ private drawInteraction_; /** * @type {boolean} * @private */ private shouldHandleDrawInteractionActiveChange_; /** * @returns {import('ol/interaction/Draw').default|import('ngeo/interaction/DrawAzimut').default|import('ngeo/interaction/MobileDraw').default} * The draw interaction. */ getDrawInteraction(): import("ol/interaction/Draw").default | import("ngeo/interaction/DrawAzimut").default | import("ngeo/interaction/MobileDraw").default; /** * Creates the draw interaction. * * @param {import('ol/style/Style').StyleLike} style The sketchStyle used for the drawing * interaction. * @param {VectorSource} source Vector source. * @returns {?import('ol/interaction/Draw').default|import('ngeo/interaction/DrawAzimut').default|import('ngeo/interaction/MobileDraw').default} * The interaction */ createDrawInteraction(style: import("ol/style/Style").StyleLike, source: VectorSource): (import("ol/interaction/Draw").default | import("ngeo/interaction/DrawAzimut").default | import("ngeo/interaction/MobileDraw").default) | null; /** * Handle draw interaction `drawstart` event. * * @param {import('lib/ol.interaction.Draw').DrawEvent|import('ngeo/CustomEvent').default} evt Event. * @private */ private onDrawStart_; /** * Handle draw interaction `drawend` event. * * @param {Event|import('ol/events/Event').default|import('ngeo/interaction/common').DrawEvent} evt Event. * @private */ private onDrawEnd_; /** * Handle unlistener events for 'end of drawing' interaction * * @private */ private unlistenerEvent_; /** * Creates a new help tooltip * * @private */ private createHelpTooltip_; /** * Destroy the help tooltip * * @private */ private removeHelpTooltip_; /** * Creates a new measure tooltip * * @private */ private createMeasureTooltip_; /** * Destroy the help tooltip * * @private */ private removeMeasureTooltip_; /** * @param {Event|import('ol/events/Event').default} evt * @private */ private updateState_; /** * Function implemented in inherited classes to compute measurement, determine * where to place the tooltip and determine which help message to display. * * @param {function(string, ?import('ol/coordinate').Coordinate): void} callback The function * to be called. */ handleMeasure(callback: (arg0: string, arg1: import("ol/coordinate").Coordinate | null) => void): void; /** * Get a reference to the tooltip element. * * @returns {Element} Tooltip Element. */ getTooltipElement(): Element; /** * Called when the draw interaction `active` property changes. If the * change is due to something else than this measure interactino, then * update follow the its active state accordingly. * * @param {Event|import('ol/events/Event').default} evt * @private */ private handleDrawInteractionActiveChange_; } import olInteractionInteraction from 'ol/interaction/Interaction'; import VectorSource from 'ol/source/Vector';