generatePositionAndOrientation method

Pair<GemError, PositionOrientation> generatePositionAndOrientation(
  1. Coordinates targetCoords
)

Generate a position at longitude, latitude in degrees, with respect to surface of focused sphere, altitude in meters above sphere (sea level), oriented toward the center of the sphere, north up.

The camera position and orientation are unchanged. The camera or any other object can then be set at the resulting position and with the resulting orientation.

Parameters

  • IN targetCoords Coordinates representing the desired latitude, longitude and altitude.

Returns

Throws

  • An exception if it fails.

Implementation

Pair<GemError, PositionOrientation> generatePositionAndOrientation(
  final Coordinates targetCoords,
) {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapCamera',
    'generatePositionAndOrientation',
    args: targetCoords,
  );

  return Pair<GemError, PositionOrientation>(
    GemErrorExtension.fromCode(resultString['result']['errorCode']),
    PositionOrientation(
      position: Point3d.fromJson(resultString['result']['tuple3D']),
      orientation: Point4d.fromJson(resultString['result']['tuple4D']),
    ),
  );
}