Skip to main content

boundsAroundPoint

The latitude and longitude box around a circle: radiusMetres north, south, east and west of centre. Used to fit a location fix's accuracy circle on screen.

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

Signature​

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

function boundsAroundPoint(centre: LatLng, radiusMetres: number): Bounds;

Parameters​

  • centre (LatLng)
  • radiusMetres (number)

Returns​

Bounds

Remarks​

Spherical, which is well within a pixel at the zooms a fix is shown at. A radius that is not a positive number gives the point itself. The box is clamped to the Web Mercator world, and the east-west span is computed at a latitude no nearer the pole than Web Mercator reaches, so it stays finite.

See also​

Source: packages/core/src/spatial/boundsAroundPoint.ts:26