Skip to content

@allmaps/types

Allmaps TypeScript types

API

Bbox

Bbox ([number, number, number, number]). Defined as [xMin, yMin, xMax, yMax]

Color

Type
[number, number, number]

ColorCount

Fields
  • color ([number, number, number])
  • count (number)

ColorWithTransparancy

Type
[number, number, number, number]

FetchFn

Type
(
input: Request | string | URL,
init?: RequestInit
) => Promise<Response>

Fit

Two ways two rectangles (or shapes in general) can overlap: ('cover' | 'contain').

  • ‘contain’: The first contains the second
  • ‘cover’: The first is covered by the second

Gcp

Fields
  • geo ([number, number])
  • resource ([number, number])

GeojsonFeature

Fields
  • geometry ( | GeojsonPoint | GeojsonLineString | GeojsonPolygon | GeojsonMultiPoint | GeojsonMultiLineString | GeojsonMultiPolygon)
  • properties (unknown)
  • type ('Feature')

GeojsonFeatureCollection

Fields
  • features (Array<GeojsonFeature>)
  • type ('FeatureCollection')

GeojsonGeometry

Type
| GeojsonPoint
| GeojsonLineString
| GeojsonPolygon
| GeojsonMultiPoint
| GeojsonMultiLineString
| GeojsonMultiPolygon

GeojsonGeometryType

Type
| 'Point'
| 'LineString'
| 'Polygon'
| 'MultiPoint'
| 'MultiLineString'
| 'MultiPolygon'

GeojsonLineString

Fields
  • coordinates (Array<Point>)
  • type ('LineString')

GeojsonMultiLineString

Fields
  • coordinates (Array<Array<Point>>)
  • type ('MultiLineString')

GeojsonMultiPoint

Fields
  • coordinates (Array<Point>)
  • type ('MultiPoint')

GeojsonMultiPolygon

Fields
  • coordinates (Array<Array<Array<Point>>>)
  • type ('MultiPolygon')

GeojsonPoint

Fields
  • coordinates ([number, number])
  • type ('Point')

GeojsonPolygon

Fields
  • coordinates (Array<Array<Point>>)
  • type ('Polygon')

Geometry

Type
| Point
| LineString
| Polygon
| MultiPoint
| MultiLineString
| MultiPolygon

Histogram

Fields
  • [bin: string] ({count: number; color: Color})

ImageInformations

Type
Map<string, unknown>

ImageRequest

Fields
  • region? ({x: number; y: number; width: number; height: number})
  • size? ({width: number; height: number})

Line

Type
[Point, Point]

LineString

Type
Array<Point>

Matrix4

Type
[
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number
]

MultiLineString

Type
Array<Array<Point>>

MultiPoint

Type
Array<Point>

MultiPolygon

Type
Array<Array<Array<Point>>>

Point

Type
[number, number]

Polygon

Type
Array<Array<Point>>

Rectangle

Rectangle (or possibly quadrilateral) ([Point, Point, Point, Point]). Winding order of points is free.

Region

Fields
  • height (number)
  • width (number)
  • x (number)
  • y (number)

Ring

Ring as [[number, number], ...] (Array<Point>).

Must contain at least 3 points May not contain duplicate points Must be unclosed: last element is not a repetition of the first May not be self-intersecting So far no requirement on self-intersection although that may be useful in future So far no requirement on winding order. This is only applied when exporting to GeoJSON

Size

Two numbers indicating the size of a Bbox as [width, height] or [xSize, ySize] ([number, number]). Alternatively, two numbers indicating the minimum and maximum of, for example, an array of numbers

SizeObject

Fields
  • height (number)
  • width (number)

SvgAttributes

Type
{[x: string]: string | number}

SvgCircle

Fields
  • attributes? ({[x: string]: string | number})
  • coordinates ([number, number])
  • type ('circle')

SvgGeometry

Type
SvgCircle | SvgLine | SvgPolyLine | SvgPolygon | SvgRect

SvgLine

Fields
  • attributes? ({[x: string]: string | number})
  • coordinates ([Point, Point])
  • type ('line')

SvgPolyLine

Fields
  • attributes? ({[x: string]: string | number})
  • coordinates (Array<Point>)
  • type ('polyline')

SvgPolygon

Fields
  • attributes? ({[x: string]: string | number})
  • coordinates (Array<Point>)
  • type ('polygon')

SvgRect

Fields
  • attributes? ({[x: string]: string | number})
  • coordinates (Array<Point>)
  • type ('rect')

Tile

Fields
  • column (number)
  • imageSize ([number, number])
  • row (number)
  • tileZoomLevel ({ scaleFactor: number width: number height: number originalWidth: number originalHeight: number columns: number rows: number })

TileByColumn

Fields
  • [key: number] ([number, number])

TileZoomLevel

Fields
  • columns (number)
  • height (number)
  • originalHeight (number)
  • originalWidth (number)
  • rows (number)
  • scaleFactor (number)
  • width (number)

Transform

Type
[number, number, number, number, number, number]

Triangle

Triangle As [[x0, y0], [x1, y1], [x2, y2]] ([Point, Point, Point]).

Winding order of points is free.

TypedLine

Type
[P, P]

TypedLineString

Type
Array<P>

TypedMultiLineString

Type
Array<Array<P>>

TypedMultiPoint

Type
Array<P>

TypedMultiPolygon

Type
Array<Array<Array<P>>>

TypedPolygon

Type
Array<Array<P>>

TypedRectangle

Type
[P, P, P, P]

TypedRing

Type
Array<P>

TypedTriangle

Type
[P, P, P]