ol
Version:
OpenLayers mapping library
115 lines • 3.4 kB
TypeScript
/**
* Update the rotate control element.
* @param {import("../MapEvent.js").default} mapEvent Map event.
* @this {Rotate}
*/
export function render(mapEvent: import("../MapEvent.js").default): void;
export class render {
/**
* Update the rotate control element.
* @param {import("../MapEvent.js").default} mapEvent Map event.
* @this {Rotate}
*/
constructor(mapEvent: import("../MapEvent.js").default);
rotation_: number;
}
export default Rotate;
export type Options = {
/**
* CSS class name.
*/
className?: string;
/**
* Text label to use for the rotate button.
* Instead of text, also an element (e.g. a `span` element) can be used.
*/
label?: string | HTMLElement;
/**
* Text label to use for the rotate tip.
*/
tipLabel?: string;
/**
* Animation duration in milliseconds.
*/
duration?: number;
/**
* Hide the control when rotation is 0.
*/
autoHide?: boolean;
/**
* Function called when the control should
* be re-rendered. This is called in a `requestAnimationFrame` callback.
*/
render?: (arg0: import("../MapEvent.js").default) => any;
/**
* Function called when the control is clicked.
* This will override the default `resetNorth`.
*/
resetNorth?: () => any;
/**
* Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/
target?: string | HTMLElement;
};
/**
* @typedef {Object} Options
* @property {string} [className='ol-rotate'] CSS class name.
* @property {string|HTMLElement} [label='⇧'] Text label to use for the rotate button.
* Instead of text, also an element (e.g. a `span` element) can be used.
* @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.
* @property {number} [duration=250] Animation duration in milliseconds.
* @property {boolean} [autoHide=true] Hide the control when rotation is 0.
* @property {function(import("../MapEvent.js").default)} [render] Function called when the control should
* be re-rendered. This is called in a `requestAnimationFrame` callback.
* @property {function()} [resetNorth] Function called when the control is clicked.
* This will override the default `resetNorth`.
* @property {HTMLElement|string} [target] Specify a target if you want the control to be
* rendered outside of the map's viewport.
*/
/**
* @classdesc
* A button control to reset rotation to 0.
* To style this control use css selector `.ol-rotate`. A `.ol-hidden` css
* selector is added to the button when the rotation is 0.
*
* @api
*/
declare class Rotate extends Control {
/**
* @param {Options=} opt_options Rotate options.
*/
constructor(opt_options?: Options);
/**
* @type {HTMLElement}
* @private
*/
private label_;
callResetNorth_: () => any;
/**
* @type {number}
* @private
*/
private duration_;
/**
* @type {boolean}
* @private
*/
private autoHide_;
/**
* @private
* @type {number|undefined}
*/
private rotation_;
/**
* @param {MouseEvent} event The event to handle
* @private
*/
private handleClick_;
/**
* @private
*/
private resetNorth_;
}
import Control from "./Control.js";
//# sourceMappingURL=Rotate.d.ts.map