# wgs84ToWebMercator

Projects a WGS 84 position (EPSG:4326) to Web Mercator (EPSG:3857).
Latitude is clamped to ±[`MAX_MERCATOR_LATITUDE`](https://docs.mapcairn.com/api/core/MAX_MERCATOR_LATITUDE.md), so a pole gives the
edge of the world square rather than infinity. Longitude is not wrapped:
a longitude past 180 degrees lands in the next world copy, and projects
back to the same value.

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

## Signature

```ts
import { wgs84ToWebMercator } from "@mapcairn/core";
 
function wgs84ToWebMercator(position: LatLng): WebMercatorPoint;
```

## Parameters

- `position` (`LatLng`)

## Returns

`WebMercatorPoint`

## Throws

- `GeometryError` of kind `invalid` when a coordinate is not finite.

## See also

- [`LatLng`](https://docs.mapcairn.com/api/core/LatLng.md)
- [`WebMercatorPoint`](https://docs.mapcairn.com/api/core/WebMercatorPoint.md)

Source: [packages/core/src/geometry/mercator.ts:42](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/geometry/mercator.ts#L42)
