Look around camera position
The default navigation of a SceneView allows you to rotate around a fixed camera position with B + Left-click + Drag. This sample shows how to rotate around the camera's position using the keyboard:
- w key: look up
- a key: look to the Left
- s key: look down
- d key: look to the right
Look up, down or to the sides is defined by camera tilt and heading. When the user hits one of the keys, the tilt or heading will be modified by 1 degree:
view.on("key-down", function(event) {
var camera = view.camera.clone();
if (event.key === "d") {
view.goTo({
position: camera.position,
heading: camera.heading + 1
}, {
animate: false
});
}
}