wrapLongitude

external fun wrapLongitude(positions: ReadonlyArray<Cartesian3>, modelMatrix: Matrix4? = definedExternally): JsAny(source)

Breaks a Polyline into segments such that it does not cross the ±180 degree meridian of an ellipsoid.

const polylines = new PolylineCollection();
const polyline = polylines.add(...);
const positions = polyline.positions;
const modelMatrix = polylines.modelMatrix;
const segments = PolylinePipeline.wrapLongitude(positions, modelMatrix);

Return

An object with a positions property that is an array of positions and a segments property.

Parameters

positions

The polyline's Cartesian positions.

modelMatrix

The polyline's model matrix. Assumed to be an affine transformation matrix, where the upper left 3x3 elements are a rotation matrix, and the upper three elements in the fourth column are the translation. The bottom row is assumed to be 0, 0, 0, 1. The matrix is not verified to be in the proper form. Default value - Matrix4.IDENTITY

See also