I would like to provide an option to draw a circle of a fixed radius in meters.
My problem is that if I enter 5 meters, I'm getting 4.99 meters if pass the LineString to sphere.getLength.
My code so far:
// 'center' comes from MapBrowserEvent<PointerEvent>.coordinate()
const forceRadius = 5;
const pointRes = getPointResolution(map.getView().getProjection(), 1, center);
const mapUnit = forceRadius / pointRes;
const radiusLineString = [center, [center[0] + mapUnit, center[1]]];
....
const geometry = new LineString(radiusLineString);
const radiusInMeter = getLength(geometry).toPrecision(3) + ' m'
How do I fix this?