Provides the logic for the Compass widget.
The Compass indicates where north is in relation to the current view rotation or camera heading. This is added to a SceneView by default.
var view = new MapView({
container: "viewDiv",
map: map
});
var compass = new Compass({
viewModel: { // autocasts as new CompassViewModel()
view: view
})
}, "compassDiv");
Constructors
new CompassViewModel(properties)
properties Object See the properties for a list of all the properties that may be passed into the constructor. |
Property Overview
Name | Type | Summary | |
---|---|---|---|
String | The name of the class. more details | more details | |
Object | The orientation axes (x, y, z). more details | more details | |
String | The view model's state. more details | more details | |
MapView | SceneView | The view in which the Compass obtains and indicates camera heading, using a (SceneView) or rotation (MapView). more details | more details |
Property Details
declaredClassStringreadonly
The name of the class. The declared class name is formatted as
esri.folder.className
.orientationObject
The orientation axes (x, y, z).
Default Value: { x: 0, y: 0, z: 0 }stateStringreadonly
The view model's state.
Known Values: compass | rotation | disabled
Default Value: disabledThe view in which the Compass obtains and indicates camera heading, using a (SceneView) or rotation (MapView).
Method Overview
Name | Return Type | Summary | |
---|---|---|---|
If working in a MapView, sets the view's rotation is to | more details |