/** * @typedef {Object} TranslateOptions * @property {import('ol/Collection').default>} [features] Only features * contained in this collection will be able to be translated. If not specified, all features on the map * will be able to be translated. * @property {import('ol/style/Style').StyleLike} [style] Style for the center features added by the * translate interaction to to show that features can be moved. */ /** * An extension of the OpenLayers Translate interaction that adds the following * features to it: * * - show a small arrow icon in the middle of the features allowing a visual * aspect that tells the user "this feature can be moved" * - pressing the ESC key automatically deactivate the interaction. * * @hidden */ export default class _default extends olInteractionTranslate { /** * @param {TranslateOptions} options Options. */ constructor(options: TranslateOptions); /** * @type {import('ol/events').EventsKey[]} * @private */ private listenerKeys_; /** * @type {Object} * @private */ private featureListenerKeys_; /** * @type {?import('ol/events').EventsKey} * @private */ private keyPressListenerKey_; /** * @type {?import('ol/Collection').default>} * @private */ private myFeatures_; /** * @type {import('ol/source/Vector').default} * @private */ private vectorSource_; /** * @type {import('ol/layer/Vector').default>} * @private */ private vectorLayer_; /** * @type {Object>} * @private */ private centerFeatures_; /** * @private */ private setState_; /** * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleFeaturesAdd_; /** * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleFeaturesRemove_; /** * @param {olFeature} feature Feature. * @private */ private addFeature_; /** * @param {olFeature} feature Feature. * @private */ private removeFeature_; /** * @param {olFeature} feature Feature being moved. * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleGeometryChange_; /** * @param {import('ol/geom/Geometry').default} geometry Geometry. * @returns {import('ol/geom/Point').default} The center point of the geometry. * @private */ private getGeometryCenterPoint_; /** * Deactivate this interaction if the ESC key is pressed. * * @param {Event|import('ol/events/Event').default} evt Event. * @private */ private handleKeyUp_; } export type TranslateOptions = { /** * Only features * contained in this collection will be able to be translated. If not specified, all features on the map * will be able to be translated. */ features?: import("ol/Collection").default>; /** * Style for the center features added by the * translate interaction to to show that features can be moved. */ style?: import("ol/style/Style").StyleLike; }; import olInteractionTranslate from 'ol/interaction/Translate'; import olFeature from 'ol/Feature';