@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
53 lines (50 loc) • 3.14 kB
TypeScript
import type Accessor from "../../core/Accessor.js";
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
import type { Axes } from "../types.js";
import type { GoTo, GoToProperties } from "../support/GoTo.js";
export interface CompassViewModelProperties extends GoToProperties, Partial<Pick<CompassViewModel, "view">> {}
export type CompassViewModelState = "disabled" | "compass" | "rotation";
/**
* Provides the logic for the [Compass](https://developers.arcgis.com/javascript/latest/references/core/widgets/Compass/) widget and [component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-compass/).
*
* The Compass indicates where north is in relation to the current view
* [MapView.rotation](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#rotation)
* or [camera heading](https://developers.arcgis.com/javascript/latest/references/core/Camera/#heading). This is added to a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
* by default.
*
* @since 4.0
* @see [Compass](https://developers.arcgis.com/javascript/latest/references/core/widgets/Compass/) widget - _Deprecated since 4.32. Use the [Compass component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-compass/) instead._
* @see [Compass component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-compass/)
* @see [Programming patterns: Widget viewModel pattern](https://developers.arcgis.com/javascript/latest/programming-patterns/#widget-viewmodel-pattern)
*/
export default class CompassViewModel extends CompassViewModelSuperclass {
constructor(properties?: CompassViewModelProperties);
/**
* The z axis orientation.
*
* @default { z: 0 }
*/
get orientation(): Axes;
/**
* The view model's state.
*
* @default "disabled"
*/
get state(): CompassViewModelState;
/**
* The view in which the Compass obtains and indicates camera
* [Camera.heading](https://developers.arcgis.com/javascript/latest/references/core/Camera/#heading), using a (SceneView) or
* [MapView.rotation](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#rotation) (MapView).
*/
accessor view: MapViewOrSceneView | null | undefined;
/**
* If working in a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/), sets the view's
* [MapView.rotation](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#rotation) is to `0`. If working in a
* [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), sets the camera's
* [Camera.heading](https://developers.arcgis.com/javascript/latest/references/core/Camera/#heading) to `0`.
*
* This method is executed each time the [Compass](https://developers.arcgis.com/javascript/latest/references/core/widgets/Compass/) is clicked.
*/
reset(): void;
}
declare const CompassViewModelSuperclass: typeof Accessor & typeof GoTo