For standard operations like zooming and panning, the MapNavigator API is sufficient. For an illustration, see here. However, 3D maps offer more degrees of freedom, and sometimes you need full control over the positioning of your camera.

The Camera API allows for such fine-grained camera control.

Note that this API operates at a lower level than the MapNavigator API. The MapNavigator API allows you to navigate both 2D and 3D maps in any reference, using the same API calls. The Camera API is specific to the type of camera used, either an OrthographicCamera or a PerspectiveCamera.

In this example, we use the Camera API to configure a new eye point and pitch, roll and yaw:

//Create a new eye point, defined in a WGS 84 reference
const wgs84Reference = getReference("CRS:84");
const eye = createPoint(wgs84Reference, [-132, 34, 3700]);
//Define new pitch, yaw and rolls
const yaw = 163;
const pitch = -45;
const roll = 0;

//When the map is a 3D map, the camera will be a perspective camera
if (map.camera instanceof PerspectiveCamera) {
  //Update the camera
  const lookFrom = map.camera.asLookFrom();
  lookFrom.eye = eye;
  lookFrom.yaw = yaw;
  lookFrom.pitch = pitch;
  lookFrom.roll = roll;
  map.camera = map.camera.lookFrom(lookFrom);
}

In addition, you will have to implement distinct Camera API calls depending on the type of the Map reference, . For more information about using the Camera API, see the reference documentation of the luciad.view.camera module and the source code of the camera sample.