Skip to content

@allmaps/render

Allmaps render module. Renders georeferenced IIIF maps specified by a Georeference Annotation.

The following renderers are implemented:

  • CanvasRenderer: renders WarpedMaps to a HTML Canvas element with the Canvas 2D API
  • WebGL2Renderer: renders WarpedMaps to a WebGL 2 context
  • IntArrayRenderer: renders WarpedMaps to an IntArray

This module is mainly used in the Allmaps pipeline by the following packages:

It is also used in the Allmaps Preview worker.

The render module accomplishes this task with the following classes:

  • All renderers use the concept of a Viewport, describing coordinate reach that should be rendered. Create a viewport using it’s constructor or the static methods in the Viewport class. The CanvasRenderer and WebGL2Renderer can deduce a viewport from the current WarpedMapList and the size of their (WebGL2-enabled) canvas.
  • All renderers extend the BaseRenderer class, which implements the general actions of the (automatically throttled) render() calls: checking which maps are inside the current viewport, initially loading their image informations, checking which zoomlevel corresponds to the viewport, getting the IIIF tiles of that zoomlevel that are within the viewport.
    • For the WebGL2Renderer, a WebGL2RenderingContext contains the rendering context for the drawing surface of an HTML element, and a WebGLProgram stores the vertex and fragment shader used for rendering a map, its lines and points.
  • A WarpedMap is made from every Georeferenced Map (which in term are parsed Georeference Annotations) and is added to the renderer and hence to its warpedMapList. It contains useful properties like mask, center, size … in resource, geospatial and projected geospatial coordinates. It contains a copy of the ground control points (GCPs) and resource masks, a projected version of the GCPs, a transformation built using the latter and usable to transform points from IIIF resource coordinates to projected geospatial coordinates.
    • If WebGL2Renderer is used, a TriangulatedWarpedMap is created for every WarpedMap, finely triangulating the map, and a WebGL2WarpedMap is created, containing the WebGL2 information of the map (buffers etc.).
  • A WarpedMapList contains the list of WarpedMaps to draw and uses an RTree for geospatial map lookup.
  • A TileCache fetches and stores the image data of cached IIIF tiles.

From Georeference Annotation to a rendered map

Section titled “From Georeference Annotation to a rendered map”

During a CanvasRenderer or IntArrayRenderer render call, a map undergoes the following steps from Georeference Annotation to the canvas:

  • For each viewport pixel, from its viewport coordinates its projected geospatial coordinates are obtained and transformed to its corresponding resource coordinates, i.e. it’s location in the IIIF image.
  • We find the tile on which this point is located, and express the resource coordinates in local tile coordinates.
  • We set the color of this pixel from the colors of the four tile pixels surrounding the tile point, through a bilinear interpolation.

During a WebGL2Renderer render call, a map undergoes the following steps from Georeference Annotation to the canvas:

  • The resource mask is triangulated: the area within is divided into small triangles.
  • The optimal tile zoom level for the current viewport is searched, telling us which IIIF tile scaleFactor to use.
  • The Viewport is transformed backwards from projected geospatial coordinates to resource coordinates of the IIIF image. The IIIF tiles covering this viewport on the resource image are fetched and cached in the TileCache.
  • The area inside the resource mask is rendered in the viewport, triangle by triangle, using the cached tiles. The location of where to render each triangle is computed using the forward transformation built from the GPCs.

This package works in browsers and in Node.js as an ESM module.

Install with pnpm:

Terminal window
pnpm install @allmaps/render

You can optionally build this package locally by running:

Terminal window
pnpm run build

The most straightforward way to use the render logic in this package is by rendering a Georeference Annotation on a webmaps using one of the Allmaps plugins (which use the WebGL2Renderer) or setting up the Allmaps TileServer (which uses the CanvasRenderer).

It’s also possible to call a renderer directly:

import { CanvasRenderer } from '@allmaps/render/canvas'
// Create a canvas and set your desired width and height
const canvas = document.getElementById('canvas')
canvas.width = width // Your width
canvas.height = height // Your height
// Create a renderer from your canvas
const renderer = new CanvasRenderer(canvas)
// Fetch and parse an annotation
const annotationUrl = 'https://annotations.allmaps.org/images/4af0fa9c8207b36c'
const annotation = await fetch(annotationUrl).then((response) =>
response.json()
)
// Add the annotation to the renderer
await renderer.addGeoreferenceAnnotation(annotation)
// Render
// Note: no viewport specified, so one will be deduced. See below.
await renderer.render()

Notes:

  • Maps with strong warping may appear to not exactly follow the specified viewport. This is due the backwards transform being explicitly used in the CanvasRenderer and IntArrayRenderer (and not in the WebGL2Renderer). For maps with strong warping, the backwards transform is currently not exact (even for polynomial transformations).
import { WebGL2Renderer } from '@allmaps/render/webgl2'
// Create a canvas and set your desired width and height
const canvas = document.getElementById('canvas')
canvas.width = width // Your width
canvas.height = height // Your height
// Get the webgl context of your canvas
const gl = canvas.getContext('webgl2', { premultipliedAlpha: true })
// Create a renderer from your canvas
const renderer = new WebGL2Renderer(gl)
// Fetch and parse an annotation
const annotationUrl = 'https://annotations.allmaps.org/images/4af0fa9c8207b36c'
const annotation = await fetch(annotationUrl).then((response) =>
response.json()
)
// Add the annotation to the renderer
await renderer.addGeoreferenceAnnotation(annotation)
// Render
// Note: no viewport specified, so one will be deduced. See below.
renderer.render()

Notes: the WebGL2Renderer is not fully functional yet.

  • The WebGL2Renderer works with events which are meant to trigger re-renders. This logic can currently be implemented outside of this library (see the plugins), and will be implemented within this library soon. As this will affect the API, please refrain from using this renderer as described above for now.
  • The WebGL2Renderer loads images via web-workers. The bundling needs to be optimised to support using this renderer in all possible environments.
import { IntArrayRenderer } from '@allmaps/render/intarray'
// Create a renderer
// See the IntArrayRenderer constructor for more info
// And the Allmaps Preview application for a concrete example
const renderer =
new IntArrayRenderer() <
D > // A data type
(getImageData, // A function to get the image date from an image
getImageDataValue, // A function to get the image data value from an image
getImageDataSize, // A function to get the image data size from an image
options) // IntArrayRenderer options
const annotationUrl = 'https://annotations.allmaps.org/images/4af0fa9c8207b36c'
const annotation = await fetch(annotationUrl).then((response) =>
response.json()
)
await renderer.addGeoreferenceAnnotation(annotation)
// Create your viewport (mandatory for this renderer)
const viewport = viewport // Your viewport, see below
const image = await renderer.render(viewport)

Notes:

  • Maps with strong warping may appear to not exactly follow the specified viewport. This is due the backwards transform being explicitly used in the CanvasRenderer and IntArrayRenderer (and not in the WebGL2Renderer). For maps with strong warping, the backwards transform is currently not exact (even for polynomial transformations).

The render() call of all renderers take a Viewport as input. For the IntArrayRenderer, this argument is required. For the others, it is optional: if unspecified a viewport will be deduced from the canvas size and the warpedMapList formed by the annotations.

A viewport can be created through one of the following options:

Directly using the Viewport constructor:

import { Viewport } from '@allmaps/render'
new Viewport(
viewportSize, // Your viewport size, as [width, height]
projectedGeoCenter, // Your center, in geo coordinates
projectedGeoPerViewportScale, // Your geo-per-viewport scale
{
rotation, // Your rotation
devicePixelRatio, // Your device pixel ratio, e.g. window.devicePixelRatio or just 1
projection // Your projection (of the above projected geospatial coordinates), as compatible with Proj4js
}
)

Using one of the following static methods:

  • Viewport.fromSizeAndMaps()
  • Viewport.fromSizeAndGeoPolygon()
  • Viewport.fromSizeAndProjectedGeoPolygon()
  • Viewport.fromScaleAndMaps()
  • Viewport.fromScaleAndGeoPolygon()
  • Viewport.fromScaleAndProjectedGeoPolygon()

For example, to derive a Viewport from a size and maps:

const viewport = Viewport.fromSizeAndMaps(
viewportSize, // Your viewport size, as [width, height]
warpedMapList, // Your WarpedMapList, e.g. `renderer.warpedMapList`
partialExtendedViewportOptions // Your extended viewport options, including viewport options (rotation, devicePixelRatio and projection (used both to retrieve the extent of the maps and for the viewport itself)), a zoom; a fit; and WarpedMapList selection options like mapIds or `onlyVisible`
)

Or, to derive a Viewport from a scale and maps:

const viewport = Viewport.fromScaleAndMaps(
projectedGeoPerViewportScale, // Your scale
warpedMapList, // Your WarpedMapList, e.g. `renderer.warpedMapList`
partialExtendedViewportOptions // Your extended viewport options, including viewport options (rotation, devicePixelRatio and projection (used both to retrieve the extent of the maps and for the viewport itself)), a zoom; and WarpedMapList selection options like mapIds or `onlyVisible`
)
// In this case, resize your canvas to the computed viewport
// before rendering, to encompass the entire image.
canvas.width = viewport.canvasSize[0]
canvas.height = viewport.canvasSize[1]
canvas.style.width = viewport.viewportSize[0] + 'px'
canvas.style.height = viewport.viewportSize[1] + 'px'
context.scale(viewport.devicePixelRatio, viewport.devicePixelRatio)

For usage examples in webmapping libraries, see the source code of the Allmaps plugins for Leaflet, MapLibre and OpenLayers.

In this package the following naming conventions are used:

  • viewport... indicates properties described in viewport coordinates (i.e. with pixel size as perceived by the user)
  • canvas... indicates properties described in canvas coordinates, so viewport device pixel ratio (i.e. with effective pixel size in memory)
  • resource... indicates properties described in resource coordinates (i.e. IIIF tile coordinates of zoomlevel 1)
  • geo... indicates properties described in geospatial coordinates (‘WGS84’, i.e. [lon, lat])
  • projectedGeo... indicates properties described in projected geospatial coordinates (following a CRS, by default ‘EPSG:3857’ WebMercator)
  • tile... indicates properties described IIIF tile coordinates

MIT

  • animate (boolean)
object & SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>
object & SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>
W extends WebGL2WarpedMap
? WebGL2WarpedMapOptions
: W extends TriangulatedWarpedMap
? TriangulatedWarpedMapOptions
: W extends WarpedMap
? WarpedMapOptions
: never
object & SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>
  • projection ({id?: string; name?: string; definition: ProjectionDefinition})
  • geoBbox? ([number, number, number, number])
  • geoPoint? ([number, number])
  • mapIds? (Iterable<string>)
  • onlyVisible? (boolean)
object
  • distortionMeasures (Array<DistortionMeasure>)
  • resourceResolution? (number)
  • animatedOptions (Array<string>)
  • createRTree (boolean)
  • rtreeUpdatedOptions (Array<string>)
  • options? (unknown)
  • type ( | 'straight' | 'helmert' | 'polynomial' | 'polynomial1' | 'polynomial2' | 'polynomial3' | 'thinPlateSpline' | 'projective' | 'linear')

new TriangulatedWarpedMap(mapId, georeferencedMap, listOptions, mapOptions)

Section titled “new TriangulatedWarpedMap(mapId, georeferencedMap, listOptions, mapOptions)”

Creates an instance of a TriangulatedWarpedMap.

  • mapId (string)
    • ID of the 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 used to construct the WarpedMap
  • listOptions? (Partial<WarpedMapListOptions> | undefined)
  • mapOptions? (Partial<WarpedMapOptions> | undefined)

TriangulatedWarpedMap.

  • WarpedMap

TriangulatedWarpedMap#clearProjectedTransformerCaches()

Section titled “TriangulatedWarpedMap#clearProjectedTransformerCaches()”

There are no parameters.

void.

TriangulatedWarpedMap#clearProjectedTriangulationCaches()

Section titled “TriangulatedWarpedMap#clearProjectedTriangulationCaches()”

There are no parameters.

void.

TriangulatedWarpedMap#clearResourceTriangulationCaches()

Section titled “TriangulatedWarpedMap#clearResourceTriangulationCaches()”

There are no parameters.

void.

SpecificTriangulatedWarpedMapOptions & WarpedMapOptions

TriangulatedWarpedMap#georeferencedMapOptions

Section titled “TriangulatedWarpedMap#georeferencedMapOptions”
{ resourceResolution?: number | undefined; distortionMeasures?: Array<DistortionMeasure> | undefined; fetchFn?: FetchFn | undefined; gcps?: Array<Gcp> | undefined; resourceMask?: Ring | undefined; ... 5 more ...; distortionMeasure?: DistortionMeasure | undefined; }
{ resourceResolution?: number | undefined; distortionMeasures?: Array<DistortionMeasure> | undefined; fetchFn?: FetchFn | undefined; gcps?: Array<Gcp> | undefined; resourceMask?: Ring | undefined; ... 5 more ...; distortionMeasure?: DistortionMeasure | undefined; }
{ resourceResolution?: number | undefined; distortionMeasures?: Array<DistortionMeasure> | undefined; fetchFn?: FetchFn | undefined; gcps?: Array<Gcp> | undefined; resourceMask?: Ring | undefined; ... 5 more ...; distortionMeasure?: DistortionMeasure | undefined; }

TriangulatedWarpedMap#mixPreviousAndNew(t)

Section titled “TriangulatedWarpedMap#mixPreviousAndNew(t)”

Mix previous transform properties with new ones (when changing an ongoing animation).

  • t (number)
    • animation progress

void.

SpecificTriangulatedWarpedMapOptions & WarpedMapOptions

TriangulatedWarpedMap#previousResourceResolution

Section titled “TriangulatedWarpedMap#previousResourceResolution”
number | undefined

TriangulatedWarpedMap#previousTrianglePointsDistortion

Section titled “TriangulatedWarpedMap#previousTrianglePointsDistortion”
Array<never>

TriangulatedWarpedMap#projectedGcpPreviousTriangulation?

Section titled “TriangulatedWarpedMap#projectedGcpPreviousTriangulation?”
{
resourceResolution: number | undefined
gcpUniquePoints: GcpAndDistortions[]
uniquePointIndices: number[]
uniquePointIndexInterpolatedPolygon: TypedPolygon<number>
}

TriangulatedWarpedMap#projectedGcpTriangulation?

Section titled “TriangulatedWarpedMap#projectedGcpTriangulation?”
{
resourceResolution: number | undefined
gcpUniquePoints: GcpAndDistortions[]
uniquePointIndices: number[]
uniquePointIndexInterpolatedPolygon: TypedPolygon<number>
}

TriangulatedWarpedMap#projectedGcpTriangulationCache

Section titled “TriangulatedWarpedMap#projectedGcpTriangulationCache”
Map<
number,
Map<string, Map<TransformationType, Map<string, GcpTriangulation>>>
>

TriangulatedWarpedMap#projectedGeoPreviousTrianglePoints

Section titled “TriangulatedWarpedMap#projectedGeoPreviousTrianglePoints”
Array<never>

TriangulatedWarpedMap#projectedGeoPreviousTriangulationAppliableMask

Section titled “TriangulatedWarpedMap#projectedGeoPreviousTriangulationAppliableMask”
Array<never>

TriangulatedWarpedMap#projectedGeoPreviousTriangulationMask

Section titled “TriangulatedWarpedMap#projectedGeoPreviousTriangulationMask”
Array<never>

TriangulatedWarpedMap#projectedGeoTrianglePoints

Section titled “TriangulatedWarpedMap#projectedGeoTrianglePoints”
Array<never>

TriangulatedWarpedMap#projectedGeoTriangulationAppliableMask

Section titled “TriangulatedWarpedMap#projectedGeoTriangulationAppliableMask”
Array<never>

TriangulatedWarpedMap#projectedGeoTriangulationMask

Section titled “TriangulatedWarpedMap#projectedGeoTriangulationMask”
Array<never>

Reset previous transform properties to new ones (when completing an animation).

There are no parameters.

void.

number | undefined

TriangulatedWarpedMap#resourceTrianglePoints

Section titled “TriangulatedWarpedMap#resourceTrianglePoints”
Array<never>

TriangulatedWarpedMap#resourceTriangulationCache

Section titled “TriangulatedWarpedMap#resourceTriangulationCache”
Map<number, Map<string, TriangulationToUnique>>

Set default options

There are no parameters.

void.

TriangulatedWarpedMap#setDistortionMeasure(distortionMeasure)

Section titled “TriangulatedWarpedMap#setDistortionMeasure(distortionMeasure)”

Set the distortionMeasure

  • distortionMeasure? (DistortionMeasure | undefined)
    • the disortion measure

void.

Update the ground control points loaded from a georeferenced map to new ground control points.

  • gcps (Array<Gcp>)
    • the new ground control points

void.

TriangulatedWarpedMap#setInternalProjection(projection)

Section titled “TriangulatedWarpedMap#setInternalProjection(projection)”

Set the internal projection

  • projection ({id?: string; name?: string; definition: ProjectionDefinition})
    • the internal projection

void.

TriangulatedWarpedMap#setProjection(projection)

Section titled “TriangulatedWarpedMap#setProjection(projection)”

Set the projection

  • projection ({id?: string; name?: string; definition: ProjectionDefinition})
    • the projection

void.

TriangulatedWarpedMap#setResourceMask(resourceFullMask, resourceAppliableMask, resourceMask)

Section titled “TriangulatedWarpedMap#setResourceMask(resourceFullMask, resourceAppliableMask, resourceMask)”

Update the resource mask loaded from a georeferenced map to a new mask.

  • resourceFullMask (Array<Point>)
  • resourceAppliableMask (Array<Point>)
  • resourceMask (Array<Point>)
    • the new mask

void.

TriangulatedWarpedMap#trianglePointsDistortion

Section titled “TriangulatedWarpedMap#trianglePointsDistortion”
Array<never>

TriangulatedWarpedMap#triangulateErrorCount

Section titled “TriangulatedWarpedMap#triangulateErrorCount”
0

TriangulatedWarpedMap#updateProjectedTransformerProperties()

Section titled “TriangulatedWarpedMap#updateProjectedTransformerProperties()”

There are no parameters.

void.

TriangulatedWarpedMap#updateTrianglePoints()

Section titled “TriangulatedWarpedMap#updateTrianglePoints()”

Derive the (previous and new) resource and projectedGeo points from their corresponding triangulations.

Also derive the (previous and new) triangulation-refined resource and projectedGeo mask

There are no parameters.

void.

TriangulatedWarpedMap#updateTrianglePointsDistortion()

Section titled “TriangulatedWarpedMap#updateTrianglePointsDistortion()”

Derive the (previous and new) distortions from their corresponding triangulations.

There are no parameters.

void.

TriangulatedWarpedMap#updateTriangulation()

Section titled “TriangulatedWarpedMap#updateTriangulation()”

Update the (previous and new) triangulation of the resourceMask. Use cache if available.

There are no parameters.

void.

Get default options

There are no parameters.

SpecificTriangulatedWarpedMapOptions & WarpedMapOptions.

SpecificTriangulatedWarpedMapOptions & WarpedMapOptions

new Viewport(viewportSize, projectedGeoCenter, projectedGeoPerViewportScale, partialViewportOptions)

Section titled “new Viewport(viewportSize, projectedGeoCenter, projectedGeoPerViewportScale, partialViewportOptions)”

Creates a new Viewport

  • viewportSize ([number, number])
    • Size of the viewport in viewport pixels, as [width, height].
  • projectedGeoCenter ([number, number])
    • Center point of the viewport, in projected geospatial coordinates.
  • projectedGeoPerViewportScale (number)
    • Scale of the viewport, in projection coordinates per viewport pixel.
  • partialViewportOptions? (Partial<ViewportOptions> | undefined)

Viewport.

[number, number, number, number]
[number, number]
[Point, Point, Point, Point]
number
[number, number]

Viewport#composeProjectedGeoToCanvasHomogeneousTransform()

Section titled “Viewport#composeProjectedGeoToCanvasHomogeneousTransform()”

There are no parameters.

[number, number, number, number, number, number].

Viewport#composeProjectedGeoToClipHomogeneousTransform()

Section titled “Viewport#composeProjectedGeoToClipHomogeneousTransform()”

There are no parameters.

[number, number, number, number, number, number].

Viewport#composeProjectedGeoToViewportHomogeneousTransform()

Section titled “Viewport#composeProjectedGeoToViewportHomogeneousTransform()”

There are no parameters.

[number, number, number, number, number, number].

Viewport#composeViewportToClipHomogeneousTransform()

Section titled “Viewport#composeViewportToClipHomogeneousTransform()”

There are no parameters.

[number, number, number, number, number, number].

Viewport#computeProjectedGeoRectangle(viewportSize, projectedGeoPerViewportScale, rotation, projectedGeoCenter)

Section titled “Viewport#computeProjectedGeoRectangle(viewportSize, projectedGeoPerViewportScale, rotation, projectedGeoCenter)”

Returns a rectangle in projected geospatial coordinates

The rectangle is the result of a horizontal rectangle in Viewport space of size ‘viewportSize’, scaled using projectedGeoPerViewportScale, centered, rotated using ‘rotation’ and translated to ‘projectedGeoCenter’.

  • viewportSize ([number, number])
  • projectedGeoPerViewportScale (number)
  • rotation (number)
  • projectedGeoCenter ([number, number])

[Point, Point, Point, Point].

number
[number, number]
[Point, Point, Point, Point]
[number, number, number, number]
number
[number, number]

Viewport#getGeoBufferedRectangle(bufferFraction)

Section titled “Viewport#getGeoBufferedRectangle(bufferFraction)”
  • bufferFraction? (number | undefined)

[Point, Point, Point, Point].

Viewport#getProjectedGeoBufferedRectangle(bufferFraction)

Section titled “Viewport#getProjectedGeoBufferedRectangle(bufferFraction)”
  • bufferFraction? (number | undefined)

[Point, Point, Point, Point].

[number, number]
number
number
[Point, Point, Point, Point]
[number, number, number, number]
number
[number, number]

Viewport#projectedGeoToCanvasHomogeneousTransform

Section titled “Viewport#projectedGeoToCanvasHomogeneousTransform”
[number, number, number, number, number, number]

Viewport#projectedGeoToClipHomogeneousTransform

Section titled “Viewport#projectedGeoToClipHomogeneousTransform”
[number, number, number, number, number, number]

Viewport#projectedGeoToViewportHomogeneousTransform

Section titled “Viewport#projectedGeoToViewportHomogeneousTransform”
[number, number, number, number, number, number]
{id?: string; name?: string; definition: ProjectionDefinition}
number
[number, number, number, number]
[number, number]
[Point, Point, Point, Point]
number
[number, number]

Viewport#viewportToClipHomogeneousTransform

Section titled “Viewport#viewportToClipHomogeneousTransform”
[number, number, number, number, number, number]

Viewport.fromScaleAndGeoPolygon(projectedGeoPerViewportScale, geoPolygon, partialExtendedViewportOptions)

Section titled “Viewport.fromScaleAndGeoPolygon(projectedGeoPerViewportScale, geoPolygon, partialExtendedViewportOptions)”

Static method that creates a Viewport from a scale and a polygon in geospatial coordinates, i.e. lon-lat EPSG:4326.

Note: the scale is still in projected geospatial per viewport pixel!

  • projectedGeoPerViewportScale (number)
    • Scale of the viewport, in projected geospatial coordinates per viewport pixel.
  • geoPolygon (Array<Array<Point>>)
    • A polygon in geospatial coordinates.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions > | undefined)

A new Viewport object (Viewport).

Viewport.fromScaleAndMaps(projectedGeoPerViewportScale, warpedMapList, partialExtendedViewportOptions)

Section titled “Viewport.fromScaleAndMaps(projectedGeoPerViewportScale, warpedMapList, partialExtendedViewportOptions)”

Static method that creates a Viewport from a scale and maps.

Optionally specify a projection, to be used both when obtaining the extent of selected warped maps in projected geospatial coordinates, as well as when create a viewport

  • projectedGeoPerViewportScale (number)
    • Scale of the viewport, in projected geospatial coordinates per viewport pixel.
  • warpedMapList (WarpedMapList<W>)
    • A WarpedMapList.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions & SelectionOptions > | undefined)
    • Optional viewport options.

A new Viewport object (Viewport).

Viewport.fromScaleAndProjectedGeoPolygon(projectedGeoPerViewportScale, projectedGeoPolygon, partialExtendedViewportOptions)

Section titled “Viewport.fromScaleAndProjectedGeoPolygon(projectedGeoPerViewportScale, projectedGeoPolygon, partialExtendedViewportOptions)”

Static method that creates a Viewport from a scale and a polygon in projected geospatial coordinates.

  • projectedGeoPerViewportScale (number)
    • Scale of the viewport, in projected geospatial coordinates per viewport pixel.
  • projectedGeoPolygon (Array<Array<Point>>)
    • A polygon in projected geospatial coordinates.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions > | undefined)

A new Viewport object (Viewport).

Viewport.fromSizeAndGeoPolygon(viewportSize, geoPolygon, partialExtendedViewportOptions)

Section titled “Viewport.fromSizeAndGeoPolygon(viewportSize, geoPolygon, partialExtendedViewportOptions)”

Static method that creates a Viewport from a size and a polygon in geospatial coordinates, i.e. lon-lat EPSG:4326.

  • viewportSize ([number, number])
    • Size of the viewport in viewport pixels, as [width, height].
  • geoPolygon (Array<Array<Point>>)
    • A polygon in geospatial coordinates.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions & FitOptions > | undefined)
    • Optional viewport options

A new Viewport object (Viewport).

Viewport.fromSizeAndMaps(viewportSize, warpedMapList, partialExtendedViewportOptions)

Section titled “Viewport.fromSizeAndMaps(viewportSize, warpedMapList, partialExtendedViewportOptions)”

Static method that creates a Viewport from a size and maps.

Optionally specify a projection, to be used both when obtaining the extent of selected warped maps in projected geospatial coordinates, as well as when create a viewport

  • viewportSize ([number, number])
    • Size of the viewport in viewport pixels, as [width, height].
  • warpedMapList (WarpedMapList<W>)
    • A WarpedMapList.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions & FitOptions & SelectionOptions > | undefined)
    • Optional viewport options

A new Viewport object (Viewport).

Viewport.fromSizeAndProjectedGeoPolygon(viewportSize, projectedGeoPolygon, partialExtendedViewportOptions)

Section titled “Viewport.fromSizeAndProjectedGeoPolygon(viewportSize, projectedGeoPolygon, partialExtendedViewportOptions)”

Static method that creates a Viewport from a size and a polygon in projected geospatial coordinates.

  • viewportSize ([number, number])
    • Size of the viewport in viewport pixels, as [width, height].
  • projectedGeoPolygon (Array<Array<Point>>)
    • A polygon in projected geospatial coordinates.
  • partialExtendedViewportOptions? ( | Partial< {rotation: number; devicePixelRatio: number} & ProjectionOptions & ZoomOptions & FitOptions > | undefined)
    • Optional viewport options

A new Viewport object (Viewport).

new WarpedMap(mapId, georeferencedMap, listOptions, mapOptions)

Section titled “new WarpedMap(mapId, georeferencedMap, listOptions, mapOptions)”

Creates an instance of WarpedMap.

  • mapId (string)
    • ID of the 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 used to construct the WarpedMap
  • listOptions (Partial<WarpedMapListOptions> | undefined)
  • mapOptions (Partial<WarpedMapOptions> | undefined)

WarpedMap.

  • EventTarget
AbortController
  • animationOptions? (Partial<AnimationOptions & AnimationOptionsInternal> | undefined)

object.

WarpedMap#clearProjectedTransformerCaches()

Section titled “WarpedMap#clearProjectedTransformerCaches()”

There are no parameters.

void.

{
fetchFn?: FetchFn
gcps: Gcp[]
resourceMask: Ring
transformationType: TransformationType
internalProjection: Projection
projection: Projection
visible: boolean
applyMask: boolean
distortionMeasure: DistortionMeasure | undefined
}

There are no parameters.

void.

'log2sigma' | 'twoOmega' | 'airyKavr' | 'signDetJ' | 'thetaa'
Array<never>
boolean
Array<Gcp>
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
{ 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...
{ fetchFn?: FetchFn | undefined; gcps?: Array<Gcp> | undefined; resourceMask?: Ring | undefined; transformationType?: TransformationType | undefined; ... 4 more ...; distortionMeasure?: DistortionMeasure | undefined; }

WarpedMap#getDefaultAndGeoreferencedMapOptions()

Section titled “WarpedMap#getDefaultAndGeoreferencedMapOptions()”

Get default and georeferenced map options

There are no parameters.

{ fetchFn?: FetchFn gcps: Gcp[] resourceMask: Ring transformationType: TransformationType internalProjection: Projection projection: Projection visible: boolean applyMask: boolean distortionMeasure: DistortionMeasure | undefined }.

WarpedMap#getProjectedTransformer(transformationType, partialProjectedGcpTransformerOptions)

Section titled “WarpedMap#getProjectedTransformer(transformationType, partialProjectedGcpTransformerOptions)”

Get a projected transformer of the given transformation type.

Uses cashed projected transformers by transformation type, and only computes a new projected transformer if none found.

Returns a projected transformer in the current projection, even if the cached transformer was computed in a different projection.

Default settings apply for the options.

  • transformationType ( | 'straight' | 'helmert' | 'polynomial' | 'polynomial1' | 'polynomial2' | 'polynomial3' | 'thinPlateSpline' | 'projective' | 'linear')
  • partialProjectedGcpTransformerOptions? (Partial<ProjectedGcpTransformerOptions> | undefined)

A projected transformer (ProjectedGcpTransformer).

Get the reference scaling from the forward transformation of the projected Helmert transformer

There are no parameters.

number.

There are no parameters.

[Point, Point, Point, Point].

WarpedMap#getResourceToCanvasScale(viewport)

Section titled “WarpedMap#getResourceToCanvasScale(viewport)”

Get scale of the warped map, in resource pixels per canvas pixels.

  • viewport (Viewport)
    • the current viewport

number.

WarpedMap#getResourceToViewportScale(viewport)

Section titled “WarpedMap#getResourceToViewportScale(viewport)”

Get scale of the warped map, in resource pixels per viewport pixels.

  • viewport (Viewport)
    • the current viewport

number.

Check if this instance has parsed image

There are no parameters.

boolean.

Image
{id?: string; name?: string; definition: ProjectionDefinition}
{ createRTree?: boolean | undefined; rtreeUpdatedOptions?: Array<string> | undefined; animatedOptions?: Array<string> | undefined; renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; ... 58 more ...; distortionMeasure?: DistortionMeasure | undefined; }

Load the parsed image from cache, or fetch and parse the image info to create it

  • imagesById (Map<string, Image>)

Promise<void>.

string
{ fetchFn?: FetchFn | undefined; gcps?: Array<Gcp> | undefined; resourceMask?: Ring | undefined; transformationType?: TransformationType | undefined; ... 4 more ...; distortionMeasure?: DistortionMeasure | undefined; }

Mix previous transform properties with new ones (when changing an ongoing animation).

  • t (number)
    • animation progress

void.

false
{
fetchFn?: FetchFn
gcps: Gcp[]
resourceMask: Ring
transformationType: TransformationType
internalProjection: Projection
projection: Projection
visible: boolean
applyMask: boolean
distortionMeasure: DistortionMeasure | undefined
}

WarpedMap#overviewFetchableTilesForViewport

Section titled “WarpedMap#overviewFetchableTilesForViewport”
Array<never>

WarpedMap#overviewTileZoomLevelForViewport?

Section titled “WarpedMap#overviewTileZoomLevelForViewport?”
{
scaleFactor: number
width: number
height: number
originalWidth: number
originalHeight: number
columns: number
rows: number
}
'log2sigma' | 'twoOmega' | 'airyKavr' | 'signDetJ' | 'thetaa'
{id?: string; name?: string; definition: ProjectionDefinition}
| 'straight'
| 'helmert'
| 'polynomial'
| 'polynomial1'
| 'polynomial2'
| 'polynomial3'
| 'thinPlateSpline'
| 'projective'
| 'linear'
Array<Gcp>
Array<Point>
[number, number, number, number]

WarpedMap#projectedGeoAppliableMaskRectangle

Section titled “WarpedMap#projectedGeoAppliableMaskRectangle”
[Point, Point, Point, Point]

WarpedMap#projectedGeoBufferedViewportRectangleBboxForViewport?

Section titled “WarpedMap#projectedGeoBufferedViewportRectangleBboxForViewport?”
[number, number, number, number]

WarpedMap#projectedGeoBufferedViewportRectangleForViewport?

Section titled “WarpedMap#projectedGeoBufferedViewportRectangleForViewport?”
[Point, Point, Point, Point]
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>

WarpedMap#projectedGeoPreviousTransformedResourcePoints

Section titled “WarpedMap#projectedGeoPreviousTransformedResourcePoints”
Array<Point>

WarpedMap#projectedGeoTransformedResourcePoints

Section titled “WarpedMap#projectedGeoTransformedResourcePoints”
Array<Point>
ProjectedGcpTransformer
ProjectedGcpTransformer
Map<TransformationType, ProjectedGcpTransformer>
Map<TransformationType, Map<string, ProjectedGcpTransformer>>
{id?: string; name?: string; definition: ProjectionDefinition}

Reset the properties for the current values

There are no parameters.

void.

Reset previous transform properties to new ones (when completing an animation).

There are no parameters.

void.

Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]

WarpedMap#resourceBufferedViewportRingBboxAndResourceMaskBboxIntersectionForViewport?

Section titled “WarpedMap#resourceBufferedViewportRingBboxAndResourceMaskBboxIntersectionForViewport?”
[number, number, number, number]

WarpedMap#resourceBufferedViewportRingBboxForViewport?

Section titled “WarpedMap#resourceBufferedViewportRingBboxForViewport?”
[number, number, number, number]

WarpedMap#resourceBufferedViewportRingForViewport?

Section titled “WarpedMap#resourceBufferedViewportRingForViewport?”
Array<Point>
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
[number, number, number, number]
[Point, Point, Point, Point]
Array<Point>
number

There are no parameters.

void.

WarpedMap#setDistortionMeasure(distortionMeasure)

Section titled “WarpedMap#setDistortionMeasure(distortionMeasure)”

Set the distortionMeasure

  • distortionMeasure? (DistortionMeasure | undefined)
    • the disortion measure

void.

WarpedMap#setFetchableTilesForViewport(fetchableTiles)

Section titled “WarpedMap#setFetchableTilesForViewport(fetchableTiles)”

Set tiles for the current viewport

  • fetchableTiles (Array<FetchableTile>)

void.

Update the ground control points loaded from a georeferenced map to new ground control points.

  • gcps (Array<Gcp>)

void.

WarpedMap#setInternalProjection(projection)

Section titled “WarpedMap#setInternalProjection(projection)”

Set the internal projection

  • projection? (Projection | undefined)
    • the internal projection

void.

WarpedMap#setListOptions(listOptions, animationOptions)

Section titled “WarpedMap#setListOptions(listOptions, animationOptions)”
  • listOptions? (Partial<WarpedMapOptions> | undefined)
  • animationOptions? (Partial<AnimationOptions> | undefined)

object.

WarpedMap#setMapOptions(mapOptions, listOptions, animationOptions)

Section titled “WarpedMap#setMapOptions(mapOptions, listOptions, animationOptions)”
  • mapOptions? (Partial<WarpedMapOptions> | undefined)
  • listOptions? (Partial<WarpedMapOptions> | undefined)
  • animationOptions? (Partial<AnimationOptions & AnimationOptionsInternal> | undefined)

object.

WarpedMap#setOverviewFetchableTilesForViewport(overviewFetchableTiles)

Section titled “WarpedMap#setOverviewFetchableTilesForViewport(overviewFetchableTiles)”

Set overview tiles for the current viewport

  • overviewFetchableTiles (Array<FetchableTile>)

void.

WarpedMap#setOverviewTileZoomLevelForViewport(tileZoomLevel)

Section titled “WarpedMap#setOverviewTileZoomLevelForViewport(tileZoomLevel)”

Set the overview tile zoom level for the current viewport

  • tileZoomLevel? (TileZoomLevel | undefined)
    • tile zoom level for the current viewport

void.

WarpedMap#setProjectedGeoBufferedViewportRectangleForViewport(projectedGeoBufferedViewportRectangle)

Section titled “WarpedMap#setProjectedGeoBufferedViewportRectangleForViewport(projectedGeoBufferedViewportRectangle)”

Set projectedGeoBufferedViewportRectangle for the current viewport

  • projectedGeoBufferedViewportRectangle? (Rectangle | undefined)

void.

Set the projection

  • projection? (Projection | undefined)
    • the projection

void.

WarpedMap#setResourceBufferedViewportRingBboxAndResourceMaskBboxIntersectionForViewport(resourceBufferedViewportRingBboxAndResourceMaskBboxIntersection)

Section titled “WarpedMap#setResourceBufferedViewportRingBboxAndResourceMaskBboxIntersectionForViewport(resourceBufferedViewportRingBboxAndResourceMaskBboxIntersection)”

Set resourceBufferedViewportRingBboxAndResourceMaskBboxIntersection for the current viewport

  • resourceBufferedViewportRingBboxAndResourceMaskBboxIntersection? (Bbox | undefined)

void.

WarpedMap#setResourceBufferedViewportRingForViewport(resourceBufferedViewportRing)

Section titled “WarpedMap#setResourceBufferedViewportRingForViewport(resourceBufferedViewportRing)”

Set resourceBufferedViewportRing for the current viewport

  • resourceBufferedViewportRing? (Ring | undefined)

void.

WarpedMap#setResourceMask(resourceFullMask, resourceAppliableMask, resourceMask)

Section titled “WarpedMap#setResourceMask(resourceFullMask, resourceAppliableMask, resourceMask)”

Update the resource mask loaded from a georeferenced map to a new mask.

  • resourceFullMask (Array<Point>)
  • resourceAppliableMask (Array<Point>)
  • resourceMask (Array<Point>)

void.

WarpedMap#setTileZoomLevelForViewport(tileZoomLevel)

Section titled “WarpedMap#setTileZoomLevelForViewport(tileZoomLevel)”

Set the tile zoom level for the current viewport

  • tileZoomLevel? (TileZoomLevel | undefined)
    • tile zoom level for the current viewport

void.

WarpedMap#setTransformationType(transformationType)

Section titled “WarpedMap#setTransformationType(transformationType)”

Set the transformationType

  • transformationType ( | 'straight' | 'helmert' | 'polynomial' | 'polynomial1' | 'polynomial2' | 'polynomial3' | 'thinPlateSpline' | 'projective' | 'linear')

void.

There are no parameters.

boolean.

There are no parameters.

boolean.

There are no parameters.

boolean.

{
scaleFactor: number
width: number
height: number
originalWidth: number
originalHeight: number
columns: number
rows: number
}
| 'straight'
| 'helmert'
| 'polynomial'
| 'polynomial1'
| 'polynomial2'
| 'polynomial3'
| 'thinPlateSpline'
| 'projective'
| 'linear'

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

WarpedMap#updateProjectedAppliableGeoMask()

Section titled “WarpedMap#updateProjectedAppliableGeoMask()”

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

WarpedMap#updateProjectedGeoMaskProperties()

Section titled “WarpedMap#updateProjectedGeoMaskProperties()”

There are no parameters.

void.

There are no parameters.

void.

WarpedMap#updateProjectedTransformerProperties()

Section titled “WarpedMap#updateProjectedTransformerProperties()”

There are no parameters.

void.

There are no parameters.

void.

WarpedMap#updateResourceToProjectedGeoScale()

Section titled “WarpedMap#updateResourceToProjectedGeoScale()”

There are no parameters.

void.

Get default options

There are no parameters.

{ fetchFn?: FetchFn gcps: Gcp[] resourceMask: Ring transformationType: TransformationType internalProjection: Projection projection: Projection visible: boolean applyMask: boolean distortionMeasure: DistortionMeasure | undefined }.

  • type (WarpedMapEventType)
  • data? (Partial<WarpedMapEventData> | undefined)

WarpedMapEvent.

  • Event
{
mapIds?: Array<string> | undefined
tileUrl?: string | undefined
optionKeys?: Array<string> | undefined
}

new WarpedMapList(warpedMapFactory, options)

Section titled “new WarpedMapList(warpedMapFactory, options)”

Creates an instance of a WarpedMapList

  • warpedMapFactory (( mapId: string, georeferencedMap: GeoreferencedMap, listOptions?: Partial<WarpedMapListOptions>, mapOptions?: Partial<WarpedMapOptions> ) => W)
    • Factory function for creating WarpedMap objects
  • options? (Partial<WarpedMapListOptions> | undefined)
    • Options of this list, which will be set on newly added maps as their list options

WarpedMapList<W>.

  • EventTarget

WarpedMapList#addEventListenersToWarpedMap(warpedMap)

Section titled “WarpedMapList#addEventListenersToWarpedMap(warpedMap)”
  • warpedMap (W)

void.

WarpedMapList#addGeoreferenceAnnotation(annotation, mapOptions)

Section titled “WarpedMapList#addGeoreferenceAnnotation(annotation, mapOptions)”

Parses an annotation and adds its georeferenced map to this list

  • annotation (unknown)
    • Annotation
  • mapOptions? (Partial<GetWarpedMapOptions<W>> | undefined)
    • Map options

Map IDs of the maps that were added, or an error per map (Promise<Array<string | Error>>).

WarpedMapList#addGeoreferencedMap(georeferencedMap, mapOptions)

Section titled “WarpedMapList#addGeoreferencedMap(georeferencedMap, mapOptions)”

Adds a georeferenced map to this list

  • georeferencedMap (unknown)
    • Georeferenced Map
  • mapOptions? (Partial<GetWarpedMapOptions<W>> | undefined)
    • Map options

Map ID of the map that was added (Promise<string>).

WarpedMapList#addGeoreferencedMapInternal(georeferencedMap, mapOptions)

Section titled “WarpedMapList#addGeoreferencedMapInternal(georeferencedMap, mapOptions)”
  • 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...)
  • mapOptions? (Partial<GetWarpedMapOptions<W>> | undefined)

Promise<string>.

Adds image informations, parses them to images and adds them to the image cache

  • imageInfos (Array<unknown>)
    • Image informations

Image IDs of the image informations that were added (Array<string>).

WarpedMapList#addToOrUpdateRtree(warpedMap)

Section titled “WarpedMapList#addToOrUpdateRtree(warpedMap)”
  • warpedMap (W)

void.

Changes the z-index of the specified maps to bring them forward

  • mapIds (Iterable<string>)
    • Map IDs

void.

Changes the z-index of the specified maps to bring them to front

  • mapIds (Iterable<string>)
    • Map IDs

void.

There are no parameters.

void.

There are no parameters.

void.

Get the default options of the list

There are no parameters.

SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions> & GetWarpedMapOptions<W>.

Get the default options of a map

These come from the default option settings for WebGL2WarpedMaps and the map’s georeferenced map proporties

  • mapId (string)
    • Map ID for which the options apply

GetWarpedMapOptions<W> | undefined.

WarpedMapList#getMapIds(partialSelectionOptions)

Section titled “WarpedMapList#getMapIds(partialSelectionOptions)”

Get mapIds for selected maps

The selectionOptions allow a.o. to:

  • filter for visible maps
  • filter for specific mapIds
  • filter for maps whose geoBbox overlap with the specified geoBbox
  • filter for maps that overlap with a given geoPoint
  • partialSelectionOptions? (Partial<SelectionOptions> | undefined)
    • Selection options (e.g. mapIds), defaults to all visible maps

mapIds (Array<string>).

Get the map-specific options of a map

  • mapId (string)
    • Map ID for which the options apply

Partial<GetWarpedMapOptions<W>> | undefined.

Get the options of a map

These options are the result of merging the default, georeferenced map, layer and map-specific options of that map.

  • mapId (string)
    • Map ID for which the options apply

GetWarpedMapOptions<W> | undefined.

Get the z-index of a map

  • mapId (string)
    • Map ID for which to get the z-index

number | undefined.

WarpedMapList#getMapsBbox(partialSelectionAndProjectionOptions)

Section titled “WarpedMapList#getMapsBbox(partialSelectionAndProjectionOptions)”

Get the bounding box of the maps in this list

The result is returned in the list’s projection, EPSG:3857 by default Use {projection: {definition: ‘EPSG:4326’}} to request the result in lon-lat EPSG:4326

  • partialSelectionAndProjectionOptions? (Partial<SelectionOptions & ProjectionOptions> | undefined)
    • Selection (e.g. mapIds) and projection options, defaults to all visible maps and current projection

The bbox of all selected maps, in the chosen projection, or undefined if there were no maps matching the selection (Bbox | undefined).

WarpedMapList#getMapsCenter(partialSelectionAndProjectionOptions)

Section titled “WarpedMapList#getMapsCenter(partialSelectionAndProjectionOptions)”

Get the center of the bounding box of the maps in this list

The result is returned in the list’s projection, EPSG:3857 by default Use {projection: {definition: ‘EPSG:4326’}} to request the result in lon-lat EPSG:4326

  • partialSelectionAndProjectionOptions? (Partial<SelectionOptions & ProjectionOptions> | undefined)
    • Selection (e.g. mapIds) and projection options, defaults to all visible maps and current projection

The center of the bbox of all selected maps, in the chosen projection, or undefined if there were no maps matching the selection (Point | undefined).

WarpedMapList#getMapsConvexHull(partialSelectionAndProjectionOptions)

Section titled “WarpedMapList#getMapsConvexHull(partialSelectionAndProjectionOptions)”

Get the convex hull of the maps in this list

The result is returned in the list’s projection, EPSG:3857 by default Use {projection: {definition: ‘EPSG:4326’}} to request the result in lon-lat EPSG:4326

  • partialSelectionAndProjectionOptions? (Partial<SelectionOptions & ProjectionOptions> | undefined)
    • Selection (e.g. mapIds) and projection options, defaults to all visible maps and current projection

The convex hull of all selected maps, in the chosen projection, or undefined if there were no maps matching the selection (Ring | undefined).

Get the options of this list

There are no parameters.

{ createRTree?: boolean | undefined; rtreeUpdatedOptions?: Array<string> | undefined; animatedOptions?: Array<string> | undefined; renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; ... 58 more ...; distortionMeasure?: DistortionMeasure | undefined; }.

WarpedMapList#getOrComputeMapId(georeferencedMap)

Section titled “WarpedMapList#getOrComputeMapId(georeferencedMap)”
  • 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...)

Promise<string>.

WarpedMapList#getProjectedGeoMaskPoints(partialSelectionAndProjectionOptions)

Section titled “WarpedMapList#getProjectedGeoMaskPoints(partialSelectionAndProjectionOptions)”
  • partialSelectionAndProjectionOptions? (Partial<SelectionOptions & ProjectionOptions> | undefined)

Array<Point>.

Get the WarpedMap instance for a map

  • mapId (string)
    • Map ID of the requested WarpedMap instance

WarpedMap instance, or undefined (W | undefined).

WarpedMapList#getWarpedMaps(partialSelectionOptions)

Section titled “WarpedMapList#getWarpedMaps(partialSelectionOptions)”

Get the WarpedMap instances for selected maps

The selectionOptions allow a.o. to:

  • filter for visible maps
  • filter for specific mapIds
  • filter for maps whose geoBbox overlap with the specified geoBbox
  • filter for maps that overlap with a given geoPoint
  • partialSelectionOptions? (Partial<SelectionOptions> | undefined)
    • Selection options (e.g. mapIds), defaults to all visible maps

WarpedMap instances (Iterable<W>).

  • mapId (string)

void.

Map<string, Image>

WarpedMapList#internalSetMapsOptionsByMapId(mapOptionsByMapId, listOptions, animationOptions)

Section titled “WarpedMapList#internalSetMapsOptionsByMapId(mapOptionsByMapId, listOptions, animationOptions)”

Internal set map options

  • mapOptionsByMapId? (Map<string, Partial<WarpedMapListOptions> | undefined> | undefined)
  • listOptions? (Partial<WarpedMapListOptions> | undefined)
  • animationOptions? (Partial<AnimationOptions> | undefined)

void.

SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>

WarpedMapList#orderMapIdsByZIndex(mapId0, mapId1)

Section titled “WarpedMapList#orderMapIdsByZIndex(mapId0, mapId1)”

Order mapIds

Use this as anonymous sort function in Array.prototype.sort()

  • mapId0 (string)
  • mapId1 (string)

number.

WarpedMapList#removeEventListenersFromWarpedMap(warpedMap)

Section titled “WarpedMapList#removeEventListenersFromWarpedMap(warpedMap)”
  • warpedMap (W)

void.

  • warpedMap (W)

void.

WarpedMapList#removeGeoreferenceAnnotation(annotation)

Section titled “WarpedMapList#removeGeoreferenceAnnotation(annotation)”

Parses an annotation and removes its georeferenced map from this list

  • annotation (unknown)

Map IDs of the maps that were removed, or an error per map (Promise<Array<string | Error>>).

WarpedMapList#removeGeoreferencedMap(georeferencedMap)

Section titled “WarpedMapList#removeGeoreferencedMap(georeferencedMap)”

Removes a georeferenced map from this list

  • georeferencedMap (unknown)

Map ID of the removed map, or an error (Promise<string | Error>).

WarpedMapList#removeGeoreferencedMapById(mapId)

Section titled “WarpedMapList#removeGeoreferencedMapById(mapId)”

Removes a georeferenced map from the list by its ID

  • mapId (string)
    • Map ID

Map ID of the removed map, or an error (Promise<string | Error | undefined>).

WarpedMapList#removeGeoreferencedMapByIdInternal(mapId)

Section titled “WarpedMapList#removeGeoreferencedMapByIdInternal(mapId)”
  • mapId (string)

Promise<string>.

WarpedMapList#removeGeoreferencedMapInternal(georeferencedMap)

Section titled “WarpedMapList#removeGeoreferencedMapInternal(georeferencedMap)”
  • 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...)

Promise<string>.

There are no parameters.

void.

WarpedMapList#resetMapsOptions(mapIds, mapOptionKeys, listOptionKeys, animationOptions)

Section titled “WarpedMapList#resetMapsOptions(mapIds, mapOptionKeys, listOptionKeys, animationOptions)”

Resets the map-specific options of maps (and the list options)

An empty array resets all options, undefined resets no options.

  • mapIds (Array<string>)
    • Map IDs for which to reset the options
  • mapOptionKeys? (Array<string> | undefined)
    • Keys of the map-specific options to reset
  • listOptionKeys? (Array<string> | undefined)
    • Keys of the list options to reset
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapList#resetMapsOptionsByMapId(mapOptionkeysByMapId, listOptionKeys, animationOptions)

Section titled “WarpedMapList#resetMapsOptionsByMapId(mapOptionkeysByMapId, listOptionKeys, animationOptions)”

Resets the map-specific options of maps by map ID (and the list options)

An empty array or map resets all options (for all maps), undefined resets no options.

  • mapOptionkeysByMapId? (Map<string, Array<string>> | undefined)
    • Keys of map-specific options to reset by map ID
  • listOptionKeys? (Array<string> | undefined)
    • Keys of the list options to reset
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapList#resetOptions(listOptionKeys, animationOptions)

Section titled “WarpedMapList#resetOptions(listOptionKeys, animationOptions)”

Resets the list options

An empty array resets all options, undefined resets no options.

  • listOptionKeys? (Array<string> | undefined)
    • Keys of the list options to reset
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

RTree

Changes the zIndex of the specified maps to send them backward

  • mapIds (Iterable<string>)
    • Map IDs

void.

Changes the z-index of the specified maps to send them to back

  • mapIds (Iterable<string>)
    • Map IDs

void.

WarpedMapList#setMapsOptions(mapIds, mapOptions, listOptions, animationOptions)

Section titled “WarpedMapList#setMapsOptions(mapIds, mapOptions, listOptions, animationOptions)”

Set the map-specific options of maps (and the list options)

  • mapIds (Array<string>)
    • Map IDs for which the options apply
  • mapOptions? (Partial<WarpedMapListOptions> | undefined)
    • Map-specific options
  • listOptions? (Partial<WarpedMapListOptions> | undefined)
    • list options
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapList#setMapsOptionsByMapId(mapOptionsByMapId, listOptions, animationOptions)

Section titled “WarpedMapList#setMapsOptionsByMapId(mapOptionsByMapId, listOptions, animationOptions)”

Set the map-specific options of maps by map ID (and the list options)

This is useful when when multiple (and possibly different) map-specific options are changed at once, but only one animation should be fired

  • mapOptionsByMapId? (Map<string, Partial<WarpedMapListOptions>> | undefined)
    • Map-specific options by map ID
  • listOptions? (Partial<WarpedMapListOptions> | undefined)
    • List options
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapList#setOptions(options, animationOptions)

Section titled “WarpedMapList#setOptions(options, animationOptions)”

Set the options of this list

Note: Map-specific options set here will be passed to newly added maps.

  • options? (Partial<WarpedMapListOptions> | undefined)
    • List Options
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

(
mapId: string,
georeferencedMap: GeoreferencedMap,
listOptions?: Partial<WarpedMapListOptions>,
mapOptions?: Partial<WarpedMapOptions>
) => W

Maps in this list, indexed by their ID (Map<string, W>).

Map<string, number>
SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>
  • applyMask (boolean)
  • distortionMeasure (DistortionMeasure | undefined)
  • fetchFn? (( input: Request | string | URL, init?: RequestInit ) => Promise<Response>)
  • gcps (Array<Gcp>)
  • internalProjection ({id?: string; name?: string; definition: ProjectionDefinition})
  • projection ({id?: string; name?: string; definition: ProjectionDefinition})
  • resourceMask (Array<Point>)
  • transformationType ( | 'straight' | 'helmert' | 'polynomial' | 'polynomial1' | 'polynomial2' | 'polynomial3' | 'thinPlateSpline' | 'projective' | 'linear')
  • visible (boolean)

There are no parameters.

( mapId: string, georeferencedMap: GeoreferencedMap, listOptions?: Partial<WarpedMapListOptions>, mapOptions?: Partial<WarpedMapOptions> ) => WarpedMap.

new IntArrayRenderer(getImageData, getImageDataValue, getImageDataSize, options)

Section titled “new IntArrayRenderer(getImageData, getImageDataValue, getImageDataSize, options)”
  • getImageData ((data: Uint8ClampedArray) => D)
  • getImageDataValue ((data: D, index: number) => number)
  • getImageDataSize ((data: D) => Size)
  • options? (Partial<BaseRenderOptions> | undefined)

IntArrayRenderer<D>.

  • BaseRenderer
  • Renderer
(data: D) => Size
(data: D, index: number) => number

Render the map for a given viewport.

  • viewport (Viewport)
    • the viewport to render

Promise<Uint8ClampedArray<ArrayBufferLike>>.

  • canvas (HTMLCanvasElement)
  • options? (Partial<BaseRenderOptions> | undefined)

CanvasRenderer.

  • BaseRenderer
  • Renderer
HTMLCanvasElement
CanvasRenderingContext2D

CanvasRenderer#getTileImageData(data, index)

Section titled “CanvasRenderer#getTileImageData(data, index)”
  • data (ImageData)
  • index (number)

number.

  • data (ImageData)

[number, number].

Render the map for a given viewport.

If no viewport is specified, a viewport is deduced based on the WarpedMapList and canvas width and hight.

  • viewport? (Viewport | undefined)
    • the viewport to render

Promise<void>.

object
  • colorize (boolean)
  • colorizeColor (string)
  • debugTiles (boolean)
  • debugTriangles (boolean)
  • debugTriangulation (boolean)
  • distortionColor00 (string)
  • distortionColor01 (string)
  • distortionColor1 (string)
  • distortionColor2 (string)
  • distortionColor3 (string)
  • opacity (number)
  • removeColor (boolean)
  • removeColorColor (string)
  • removeColorHardness (number)
  • removeColorThreshold (number)
  • renderAppliableMask (boolean)
  • renderAppliableMaskBorderColor? (string)
  • renderAppliableMaskBorderSize? (number)
  • renderAppliableMaskColor? (string)
  • renderAppliableMaskSize? (number)
  • renderFullMask (boolean)
  • renderFullMaskBorderColor? (string)
  • renderFullMaskBorderSize? (number)
  • renderFullMaskColor? (string)
  • renderFullMaskSize? (number)
  • renderGcps (boolean)
  • renderGcpsBorderColor? (string)
  • renderGcpsBorderSize? (number)
  • renderGcpsColor? (string)
  • renderGcpsSize? (number)
  • renderGrid (boolean)
  • renderGridColor (string)
  • renderLines? (boolean)
  • renderMaps? (boolean)
  • renderMask (boolean)
  • renderMaskBorderColor? (string)
  • renderMaskBorderSize? (number)
  • renderMaskColor? (string)
  • renderMaskSize? (number)
  • renderPoints? (boolean)
  • renderTransformedGcps (boolean)
  • renderTransformedGcpsBorderColor? (string)
  • renderTransformedGcpsBorderSize? (number)
  • renderTransformedGcpsColor? (string)
  • renderTransformedGcpsSize? (number)
  • renderVectors (boolean)
  • renderVectorsBorderColor? (string)
  • renderVectorsBorderSize? (number)
  • renderVectorsColor? (string)
  • renderVectorsSize? (number)
  • saturation (number)
object & SpecificWarpedMapListOptions & Partial<WebGL2WarpedMapOptions>

Creates an instance of WebGL2Renderer.

  • gl (WebGL2RenderingContext)
    • WebGL 2 rendering context
  • options? (Partial<WebGL2RenderOptions> | undefined)
    • options

WebGL2Renderer.

  • BaseRenderer
  • Renderer

WebGL2Renderer#addEventListenersToWebGL2WarpedMap(webgl2WarpedMap)

Section titled “WebGL2Renderer#addEventListenersToWebGL2WarpedMap(webgl2WarpedMap)”
  • webgl2WarpedMap (WebGL2WarpedMap)

void.

  • event (Event)

void.

false

WebGL2Renderer#animationFrame(now, mapIds)

Section titled “WebGL2Renderer#animationFrame(now, mapIds)”
  • now (number)
  • mapIds (Array<string>)

void.

0
number | undefined

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

  • mapId (string)

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

false
  • mapIds (Array<string>)

void.

WebGL2RenderingContext
  • event (Event)

void.

  • event (Event)

void.

  • gl (WebGL2RenderingContext)

void.

WebGL2Renderer#lastAnimationFrameRequestId

Section titled “WebGL2Renderer#lastAnimationFrameRequestId”
number | undefined
WebGLProgram
WebGLProgram
  • event (Event)

void.

  • event (Event)

void.

{ createRTree?: boolean | undefined; rtreeUpdatedOptions?: Array<string> | undefined; animatedOptions?: Array<string> | undefined; renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; ... 58 more ...; distortionMeasure?: DistortionMeasure | undefined; }
WebGLProgram
  • event (Event)

void.

There are no parameters.

void.

WebGL2Renderer#previousSignificantViewport

Section titled “WebGL2Renderer#previousSignificantViewport”
Viewport | undefined

WebGL2Renderer#removeEventListenersFromWebGL2WarpedMap(webgl2WarpedMap)

Section titled “WebGL2Renderer#removeEventListenersFromWebGL2WarpedMap(webgl2WarpedMap)”
  • webgl2WarpedMap (WebGL2WarpedMap)

void.

Render the map for a given viewport.

If no viewport is specified the current viewport is rerendered. If no current viewport is known, a viewport is deduced based on the WarpedMapList and canvas width and hight.

  • viewport? (Viewport | undefined)
    • the current viewport

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

  • mapIds? (Array<string> | undefined)

void.

WebGL2Renderer#setLinesProgramMapUniforms(webgl2WarpedMap)

Section titled “WebGL2Renderer#setLinesProgramMapUniforms(webgl2WarpedMap)”
  • webgl2WarpedMap (WebGL2WarpedMap)

void.

There are no parameters.

void.

WebGL2Renderer#setMapProgramMapUniforms(webgl2WarpedMap)

Section titled “WebGL2Renderer#setMapProgramMapUniforms(webgl2WarpedMap)”
  • webgl2WarpedMap (WebGL2WarpedMap)

void.

There are no parameters.

void.

WebGL2Renderer#setPointsProgramMapUniforms(webgl2WarpedMap)

Section titled “WebGL2Renderer#setPointsProgramMapUniforms(webgl2WarpedMap)”
  • webgl2WarpedMap (WebGL2WarpedMap)

void.

There are no parameters.

void.

WebGL2Renderer#shouldAnticipateInteraction()

Section titled “WebGL2Renderer#shouldAnticipateInteraction()”

There are no parameters.

boolean.

WebGL2Renderer#shouldRequestFetchableTiles()

Section titled “WebGL2Renderer#shouldRequestFetchableTiles()”

There are no parameters.

boolean.

  • mapIds (Array<string>)

void.

DebouncedFunc<() => void>

WebGL2Renderer#throttledPrepareRenderInternal

Section titled “WebGL2Renderer#throttledPrepareRenderInternal”
DebouncedFunc<() => void>

WebGL2Renderer#updateMapsForViewport(allFechableTilesForViewport, allRequestedTilesForViewport)

Section titled “WebGL2Renderer#updateMapsForViewport(allFechableTilesForViewport, allRequestedTilesForViewport)”
  • allFechableTilesForViewport (Array<FetchableTile>)
  • allRequestedTilesForViewport (Array<FetchableTile>)

{mapsEnteringViewport: string[]; mapsLeavingViewport: string[]}.

WebGL2Renderer#updateVertexBuffers(mapIds)

Section titled “WebGL2Renderer#updateVertexBuffers(mapIds)”
  • mapIds? (Array<string> | undefined)

void.

  • event (Event)

void.

new WebGL2WarpedMap(mapId, georeferencedMap, gl, mapProgram, linesProgram, pointsProgram, listOptions, mapOptions)

Section titled “new WebGL2WarpedMap(mapId, georeferencedMap, gl, mapProgram, linesProgram, pointsProgram, listOptions, mapOptions)”

Creates an instance of WebGL2WarpedMap.

  • mapId (string)
    • ID of the 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 used to construct the WarpedMap
  • gl (WebGL2RenderingContext)
    • WebGL rendering context
  • mapProgram (WebGLProgram)
    • WebGL program for map
  • linesProgram (WebGLProgram)
  • pointsProgram (WebGLProgram)
  • listOptions? (Partial<WarpedMapListOptions> | undefined)
  • mapOptions? (Partial<WebGL2WarpedMapOptions> | undefined)

WebGL2WarpedMap.

  • TriangulatedWarpedMap

WebGL2WarpedMap#addCachedTileAndUpdateTextures(cachedTile)

Section titled “WebGL2WarpedMap#addCachedTileAndUpdateTextures(cachedTile)”

Add cached tile to the textures of this map and update textures

  • cachedTile (CachedTile<ImageData>)

void.

WebGL2WarpedMap#applyOptions(animationOptions)

Section titled “WebGL2WarpedMap#applyOptions(animationOptions)”
  • animationOptions? (Partial<AnimationOptions> | undefined)

object.

Map<string, CachedTile<ImageData>>
Map<string, CachedTile<ImageData>>
Array<never>

WebGL2WarpedMap#cachedTilesResourceOriginPointsAndDimensionsTexture

Section titled “WebGL2WarpedMap#cachedTilesResourceOriginPointsAndDimensionsTexture”
null

WebGL2WarpedMap#cachedTilesScaleFactorsTexture

Section titled “WebGL2WarpedMap#cachedTilesScaleFactorsTexture”
null
null

WebGL2WarpedMap#cancelThrottledFunctions()

Section titled “WebGL2WarpedMap#cancelThrottledFunctions()”

There are no parameters.

void.

Clear textures for this map

There are no parameters.

void.

SpecificWebGL2WarpedMapOptions &
SpecificTriangulatedWarpedMapOptions &
WarpedMapOptions

There are no parameters.

void.

{ renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; renderGcps?: boolean | undefined; renderGcpsColor?: string | undefined; renderGcpsSize?: number | undefined; renderGcpsBorderColor?: string | undefined; ... 54 more ...; distortionMeasure?: DistortionMeasure | ...

WebGL2WarpedMap#getCachedTilesAtOtherScaleFactors(tile)

Section titled “WebGL2WarpedMap#getCachedTilesAtOtherScaleFactors(tile)”
  • tile ({ column: number row: number tileZoomLevel: TileZoomLevel imageSize: Size })

Array<CachedTile<ImageData>>.

WebGL2RenderingContext
Image
string

WebGL2WarpedMap#initializeWebGL(mapProgram, linesProgram, pointsProgram)

Section titled “WebGL2WarpedMap#initializeWebGL(mapProgram, linesProgram, pointsProgram)”
  • mapProgram (WebGLProgram)
  • linesProgram (WebGLProgram)
  • pointsProgram (WebGLProgram)

void.

WebGL2WarpedMap#invertedRenderHomogeneousTransform

Section titled “WebGL2WarpedMap#invertedRenderHomogeneousTransform”
[number, number, number, number, number, number]
Array<never>
WebGLProgram
null
{ renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; renderGcps?: boolean | undefined; renderGcpsColor?: string | undefined; renderGcpsSize?: number | undefined; renderGcpsBorderColor?: string | undefined; ... 54 more ...; distortionMeasure?: DistortionMeasure | ...
{ renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; renderGcps?: boolean | undefined; renderGcpsColor?: string | undefined; renderGcpsSize?: number | undefined; renderGcpsBorderColor?: string | undefined; ... 54 more ...; distortionMeasure?: DistortionMeasure | ...
WebGLProgram
null
SpecificWebGL2WarpedMapOptions &
SpecificTriangulatedWarpedMapOptions &
WarpedMapOptions
Array<never>
WebGLProgram
null

WebGL2WarpedMap#previousCachedTilesForTexture

Section titled “WebGL2WarpedMap#previousCachedTilesForTexture”
Array<never>

WebGL2WarpedMap#removeCachedTileAndUpdateTextures(tileUrl)

Section titled “WebGL2WarpedMap#removeCachedTileAndUpdateTextures(tileUrl)”

Remove cached tile from the textures of this map and update textures

  • tileUrl (string)

void.

Set default options

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

void.

There are no parameters.

boolean.

There are no parameters.

boolean.

There are no parameters.

boolean.

DebouncedFunc<() => Promise<void>>
  • tile ({ column: number row: number tileZoomLevel: TileZoomLevel imageSize: Size })

boolean.

  • tile ({ column: number row: number tileZoomLevel: TileZoomLevel imageSize: Size })

CachedTile<ImageData> | undefined.

WebGL2WarpedMap#updateCachedTilesForTextures()

Section titled “WebGL2WarpedMap#updateCachedTilesForTextures()”

There are no parameters.

void.

There are no parameters.

Promise<void>.

WebGL2WarpedMap#updateVertexBuffers(projectedGeoToClipHomogeneousTransform)

Section titled “WebGL2WarpedMap#updateVertexBuffers(projectedGeoToClipHomogeneousTransform)”

Update the vertex buffers of this warped map

  • projectedGeoToClipHomogeneousTransform ([number, number, number, number, number, number])
    • Transform from projected geo coordinates to webgl2 coordinates in the [-1, 1] range. Equivalent to OpenLayers’ projectionTransform.

void.

WebGL2WarpedMap#updateVertexBuffersLines(projectedGeoToClipHomogeneousTransform)

Section titled “WebGL2WarpedMap#updateVertexBuffersLines(projectedGeoToClipHomogeneousTransform)”
  • projectedGeoToClipHomogeneousTransform ([number, number, number, number, number, number])

void.

WebGL2WarpedMap#updateVertexBuffersMap(projectedGeoToClipHomogeneousTransform)

Section titled “WebGL2WarpedMap#updateVertexBuffersMap(projectedGeoToClipHomogeneousTransform)”
  • projectedGeoToClipHomogeneousTransform ([number, number, number, number, number, number])

void.

WebGL2WarpedMap#updateVertexBuffersPoints(projectedGeoToClipHomogeneousTransform)

Section titled “WebGL2WarpedMap#updateVertexBuffersPoints(projectedGeoToClipHomogeneousTransform)”
  • projectedGeoToClipHomogeneousTransform ([number, number, number, number, number, number])

void.

Get default options

There are no parameters.

SpecificWebGL2WarpedMapOptions & SpecificTriangulatedWarpedMapOptions & WarpedMapOptions.

SpecificWebGL2WarpedMapOptions &
SpecificTriangulatedWarpedMapOptions &
WarpedMapOptions