Skip to main content

unwrapLongitudes

The positions of a path with each longitude moved to the copy nearest the one before it, and the first to the copy nearest referenceLng, so every step goes the short way (170 to -170 becomes 170 to 190). Only for drawing: stored, exported and shared positions keep their own longitudes.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { unwrapLongitudes } from "@mapcairn/core";

function unwrapLongitudes(positions: readonly LatLng[], referenceLng: number): LatLng[];

Parameters​

  • positions (readonly LatLng[])
  • referenceLng (number)

Returns​

LatLng[]

See also​

Source: packages/core/src/globe/longitude.ts:30