UNPKG

@arcgis/map-components

Version:
26 lines (25 loc) 956 B
/// <reference types="@arcgis/core/interfaces.d.ts" /> import { Nil } from '@arcgis/components-utils'; import { DirectionalPadAngle } from './constants'; export interface Vector { readonly x: number; readonly y: number; } /** * Find which of the 8 directions is closest to a given vector * * @private */ export declare function vectorToClosestAngle(vector: Vector): DirectionalPadAngle; export declare function unitVectorToAngle({ x, y }: Vector): number; export declare function angleToUnitVector(angle: number): Vector; export declare function deg2rad(d: number): number; export declare function rad2deg(r: number): number; export declare function toUnitVector(first: Vector, second: Vector): Vector; /** * Given an HTML element, find it's center coordinates * * @private */ export declare function findElementCenter(element: Element): Vector; export declare function canShowNorth(view: __esri.MapView | __esri.SceneView | Nil): boolean;