@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
64 lines (63 loc) • 2.01 kB
TypeScript
import type { Feature, Map } from 'ol';
import { Style } from 'ol/style.js';
import ConfigManager from '../../../tools/configuration/configmanager.js';
/**
* Helps to highlight features on the map by adding an animated
* style around the features.
*/
export declare class FocusFeature {
/** Duration of a flash animation in ms. */
private readonly flashDuration;
private readonly olMap;
private readonly configManager;
private readonly flashStyleCache;
private focusLayer?;
private focusSource?;
private focusAnimation;
private strokeColor;
constructor(map: Map, configManager: ConfigManager);
setFocusedFeatures(features: Feature[] | null): void;
/**
* Create animated layer for focussing feature.
* @private
*/
private createFocusLayer;
/**
* Set the style of the focus layer.
* @private
*/
private setFocusLayerStyle;
/**
* Activates the flash animation for the given features.
* On null features or empty array, the animation ends.
* @private
*/
private flash;
/**
* Redraw the geometry.
* @private
*/
private animate;
/**
* Get the "flash" style at the current frameState.time.
* Use cache to not create new style object every N ms!
* @returns The "Flash" style.
* @private
*/
private getFlashStyleCache;
/**
* @param values - With [radius, opacity, offset] expected.
* @param color - stroke color of flash animation
* @returns A new "flash" style object based on the given values.
* @static
*/
static createFlashStyle(values: number[], color: number[]): Style;
/**
* @returns Based on the given frameStateTime, a duration and a easeOut
* function (quick to slow), returns values:
* from [radius=5, opacity=1, offset=0]
* to [radius=30, opacity=0, offset=48]
* @static
*/
static getFlashDynamicValues(frameStateTime: number, duration: number): number[];
}