Skip to main content

placePath

Places a path on the screen. Every segment goes the short way, across the antimeridian when that is shorter, starting on the copy of the world nearest the view centre. On a globe each segment is also cut into pieces along its great circle, short enough to stay within GLOBE_CHORD_TOLERANCE_PX of the curve, so long lines bend with the sphere, and a piece that goes over the horizon gains a point where it does, so the line reaches the edge of the disc. On a flat map segments stay straight on the screen.

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

Signature​

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

function placePath(positions: readonly LatLng[], closed: boolean, placement: MapPlacement): PlacedPath;

Parameters​

  • positions (readonly LatLng[])
  • closed (boolean)
  • placement (MapPlacement)

Returns​

PlacedPath

See also​

Source: packages/core/src/globe/placement.ts:106