Skip to content

@allmaps/bearing

Computes the bearing of a Georeferenced Map.

import { parseAnnotation, generateAnnotation } from '@allmaps/annotation'
import { computeGeoreferencedMapBearing } from '@allmaps/bearing'
const annotation = await fetch(
'https://annotations.allmaps.org/maps/0d76ed1b985f3913@cf34c4646fee9f4d'
).then((response) => response.json())
const maps = parseAnnotation(annotation)
const bearing = computeGeoreferencedMapBearing(maps[0])
console.log(bearing)

MIT

computeGeoreferencedMapBearing(georeferencedMap, options)

Section titled “computeGeoreferencedMapBearing(georeferencedMap, options)”

Computes the bearing of a Georeferenced Map.

  • georeferencedMap ({ type: "GeoreferencedMap"; resource: { type: "ImageService1" | "ImageService2" | "ImageService3" | "Canvas"; id: string; height?: number | undefined; width?: number | undefined; partOf?: ({ type: string; id: string; label?: Record<string, (string | number | boolean)[]> | undefined; } & { partOf?: ({ type: string; i...)
    • Georeferenced Map
  • options? (Partial<{ internalProjection: Projection; projection: Projection; } & { differentHandedness: boolean; } & { maxDepth: number; minOffsetRatio: number; minOffsetDistance: number; minLineDistance: number; ... 4 more ...; preToResource: ProjectionFunction; } & MultiGeometryOptions & TransformationTypeInputs> | undefined)

The bearing of the map in degrees, measured from the north line (number).

computeWarpedMapBearing(warpedMap, options)

Section titled “computeWarpedMapBearing(warpedMap, options)”

Computes the bearing of a Warped Map.

  • warpedMap (WarpedMap)
    • Warped Map
  • options? (Partial<{ internalProjection: Projection; projection: Projection; } & { differentHandedness: boolean; } & { maxDepth: number; minOffsetRatio: number; minOffsetDistance: number; minLineDistance: number; ... 4 more ...; preToResource: ProjectionFunction; } & MultiGeometryOptions & TransformationTypeInputs> | undefined)

The bearing of the map in degrees, measured from the north line (number).