UNPKG

@terrestris/ol-util

Version:

A set of helper classes for working with openLayers

31 lines (30 loc) 1.43 kB
import OlFeature from 'ol/Feature'; import OlGeometry from 'ol/geom/Geometry'; import OlLayerVector from 'ol/layer/Vector'; import OlMap from 'ol/Map'; import OlSourceVector from 'ol/source/Vector'; import OlStyle from 'ol/style/Style'; /** * This class provides some static methods which might be helpful when working * with digitize functions to animate features. * * @class AnimateUtil */ declare class AnimateUtil { /** * Moves / translates an `OlFeature` to the given `pixel` delta * in the end with given `duration` in ms, using the given style. * * @param {import("ol/Map").default} map An OlMap. * @param {import("ol/layer/Vector").default<import("ol/source/Vector").default>} layer A vector layer to receive a * postrender event. * @param {import("ol/Feature").default} featureToMove The feature to move. * @param {number} duration The duration in ms for the moving to complete. * @param {number} pixel Delta of pixels to move the feature. * @param {import("ol/style/Style").default} [style] The style to use when moving the feature. * * @return {Promise<import("ol/Feature").default>} Promise of the moved feature. */ static moveFeature(map: OlMap, layer: OlLayerVector<OlSourceVector>, featureToMove: OlFeature<OlGeometry>, duration: number, pixel: number, style: OlStyle): Promise<OlFeature<OlGeometry>>; } export default AnimateUtil;