Skip to content

@ue-too/border / index / inverseMercatorProjection

函式: inverseMercatorProjection()

inverseMercatorProjection(point, centerLongitude): GeoCoord

定義於: projection.ts:85

Converts a Mercator projection point back to geographic coordinates.

參數

point

Point

The point in Mercator projection (in meters)

centerLongitude

number = 0

The central meridian in degrees (must match the forward projection)

回傳

GeoCoord

The geographic coordinate

備註

This is the inverse of mercatorProjection. Given a point in Mercator projection space (in meters), it returns the corresponding latitude/longitude.

範例

typescript
const point = { x: -14232.4, y: 6711665.7 };
const coord = inverseMercatorProjection(point);
console.log(coord); // { latitude: ~51.5, longitude: ~-0.13 }