Skip to content

@allmaps/openlayers

Allmaps plugin for OpenLayers. This plugin allows displaying georeferenced IIIF images on an OpenLayers map. The plugin works by loading Georeference Annotations and uses WebGL to transform images from a IIIF image server to overlay them on their correct geographical position.

See allmaps.org for more information.

Example of the Allmaps plugin for OpenLayers

Examples:

This plugin exports the class WarpedMapLayer. You can add one or multiple Georeference Annotations (or AnnotationPages that contain multiple Georeference Annotations) to a WarpedMapLayer and add the WarpedMapLayer to your OpenLayers map. This will render all georeferenced maps defined by the Georeference Annotations.

To understand what happens under the hood for each georeferenced map, see the @allmaps/render package.

This plugin implements a lot of methods from @allmaps/warpedmaplayer, the core package gathering the functionality connecting the Allmaps plugins to the @allmaps/render package.

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

Install with pnpm:

Terminal window
pnpm install @allmaps/openlayers

You can optionally build this package locally by running:

Terminal window
pnpm run build

The easiest way to test this package during local development is via @allmaps/test-plugins. A minimal example is also included in ./index.html and can be served via pnpm run dev.

Built for OpenLayers 10, but should work with OpenLayers 9, 8, 7 and 6 as well.

Creating a WarpedMapLayer and adding a Georeference Annotation to an OpenLayers map looks like this:

import OpenLayersMap from 'ol/Map'
import Tile from 'ol/layer/Tile'
import OSM from 'ol/source/OSM'
import { WarpedMapLayer } from '@allmaps/openlayers'
const map = new OpenLayersMap({
target: 'map',
layers: [
new Tile({
source: new OSM()
})
]
})
const annotationUrl = 'https://annotations.allmaps.org/maps/a9458d2f895dcdfb'
const warpedMapLayer = new WarpedMapLayer()
map.addLayer(warpedMapLayer)
warpedMapLayer.addGeoreferenceAnnotationByUrl(annotationUrl).then(() => {
const bbox = warpedMapLayer.getBbox({
projection: { definition: 'EPSG:3857' }
})
if (bbox) {
map.getView().fit(bbox)
}
})

Once the layer has been added to the map, a Georeference Annotation can be added to a WarpedMapLayer using the addGeoreferenceAnnotation and addGeoreferenceAnnotationByUrl functions:

fetch(annotationUrl)
.then((response) => response.json())
.then((annotation) => warpedMapLayer.addGeoreferenceAnnotation(annotation))

Or:

await warpedMapLayer.addGeoreferenceAnnotationByUrl(annotationUrl)

It’s also possible to create a WarpedMapList first and pass it to the layer on creation. This has the advantage of being able to compute properties of a WarpedMapList first, e.g. getting the bounds and passing it to the OpenLayers Map.

import OpenLayersMap from 'ol/Map'
import Tile from 'ol/layer/Tile'
import OSM from 'ol/source/OSM'
import { WarpedMapLayer } from '@allmaps/openlayers'
import { WarpedMapList } from '@allmaps/render'
import { WebGL2WarpedMap } from '@allmaps/render/webgl2'
const annotationUrl =
'https://annotations.allmaps.org/manifests/8f9faeba73d67031'
const annotation = await fetch(annotationUrl).then((response) =>
response.json()
)
const warpedMapList = new WarpedMapList<WebGL2WarpedMap>()
await warpedMapList.addGeoreferenceAnnotation(annotation)
const bbox = warpedMapList.getMapsBbox({ projection: { definition: 'EPSG:3857' } })
const map = new OpenLayersMap({
target: 'map',
layers: [
new Tile({
source: new OSM()
})
],
view: new View().fit(bbox, {
padding: [20, 20, 20, 20]
})
})
const warpedMapLayer = new WarpedMapLayer({ warpedMapList })
map.addLayer(warpedMapLayer)

Note that the ...ByUrl() functions are not available on a WarpedMapList.

See the @allmaps/warpedmaplayer package for the API documentation of the methods coming from the WarpedMapLayer class (shared by all Allmaps plugins). It describes the methods like addGeoreferenceAnnotation() and includes a list of all options that can be set on instances of the class and all events which are passed to the native map instance hosting the layer instance.

You can set options on the entire layer, or on a specific map on the layer (overwriting layer options):

warpedMapLayer.setLayerOptions({ visible: true })
warpedMapLayer.setMapOptions(mapId, { visible: true })

You can listen to events in the typical way:

map.on('warpedmapadded', (event) => {
console.log(event.mapIds)
})

Allmaps supports two types of map projections as documented in @allmaps/project: internal projections and viewport projections. OpenLayers supports custom view projections, too. The Allmaps OpenLayers plugin can read the projection of the view of an OpenLayers map and apply it.

To set a custom projection to an OpenLayers map and have Allmaps pick it up, use the register function as foreseen in OpenLayers. (This works because the plugin loads Proj4 as a peer dependency.)

Optionally, also register your custom projections with the warpedMapLayer. This allows using the projection objects (including properties like id and name) through-out Allmaps. If omitted, the plugin will create new projection object containing only the definition.

import proj4 from 'proj4'
//... other imports
// const map = ...
// const warpedMapLayer = ...
const myProjection = {
id: 'EPSG:28992',
name: 'RD new',
definition:
'+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,1.9342,-1.6677,9.1019,4.0725 +units=m +no_defs +type=crs'
}
proj4.defs(myProjection.id, projection.definition)
register(proj4)
// Optional
warpedMapLayer.registerProjections([myProjection])

Then, create a new view with that projection and set the bbox, computed using the current projection:

const bbox = warpedMapLayer.getBbox({ projection: myProjection })
if (bbox) {
map.setView(
new View({
projection: myProjection.id
})
)
map.getView().fit(bbox)
}

MIT

  • type (string)
  • data (unknown)

OLWarpedMapEvent.

  • Event
unknown
object & Partial<WebGL2RenderOptions>

Creates a WarpedMapLayer instance

  • options? (Partial<OpenLayersWarpedMapLayerOptions> | undefined)
    • the WebGL2 renderer options

WarpedMapLayer.

  • Layer
  • BaseWarpedMapLayer

There are no parameters.

void.

WarpedMapLayer#addGeoreferenceAnnotation(annotation, mapOptions)

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

Adds a Georeference Annotation

  • annotation (unknown)
    • Georeference Annotation
  • mapOptions? (Partial<WebGL2WarpedMapOptions> | undefined)
    • Map options

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

WarpedMapLayer#addGeoreferenceAnnotationByUrl(annotationUrl, mapOptions)

Section titled “WarpedMapLayer#addGeoreferenceAnnotationByUrl(annotationUrl, mapOptions)”

Adds a Georeference Annotation by URL

  • annotationUrl (string)
    • URL of a Georeference Annotation
  • mapOptions? (Partial<WebGL2WarpedMapOptions> | undefined)
    • Map options

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

WarpedMapLayer#addGeoreferencedMap(georeferencedMap, mapOptions)

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

Adds a Georeferenced Map

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

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

Adds image information to the WarpedMapList’s image information cache

  • imageInfos (Array<unknown>)
    • Image informations

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

WarpedMapLayer#addSprites(sprites, imageUrl, imageSize)

Section titled “WarpedMapLayer#addSprites(sprites, imageUrl, imageSize)”

Adds sprites to the Renderer’s sprite tile cache

This adds tiles from sprites to warped maps in WarpedMapList. Load maps before running this function. This uses the image info of related maps. When using addImageInfos(), call it before calling this function.

  • sprites (Array<Sprite>)
    • Sprites
  • imageUrl (string)
    • Image url
  • imageSize ([number, number])
    • Image size

Promise<void>.

Bring maps forward

  • mapIds (Iterable<string>)
    • IDs of the maps

void.

Bring maps to front

  • mapIds (Iterable<string>)
    • IDs of the maps

void.

HTMLCanvasElement
[number, number]

Removes all warped maps from the layer

There are no parameters.

void.

HTMLDivElement
  • event (Event)

void.

  • event (Event)

void.

WarpedMapLayer#defaultSpecificWarpedMapLayerOptions

Section titled “WarpedMapLayer#defaultSpecificWarpedMapLayerOptions”
object

Disposes all WebGL resources and cached tiles

There are no parameters.

void.

Get the bounding box of all maps in the layer

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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

WarpedMapLayer#getCenter(projectionOptions)

Section titled “WarpedMapLayer#getCenter(projectionOptions)”

Get the center of the bounding box of all maps in the layer

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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

WarpedMapLayer#getConvexHull(projectionOptions)

Section titled “WarpedMapLayer#getConvexHull(projectionOptions)”

Get the convex hull of all maps in the layer

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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

Get the default options the layer

There are no parameters.

object & SpecificBaseRenderOptions<WebGL2WarpedMap> & Partial<WarpedMapListOptions<WebGL2WarpedMap>> & SpecificWebGL2WarpedMapOptions & SpecificTriangulatedWarpedMapOptions & WarpedMapOptions.

Get the layer options

There are no parameters.

{ warpedMapFactory?: WarpedMapFactory<WebGL2WarpedMap> | undefined; warpedMapList?: WarpedMapList<WebGL2WarpedMap> | undefined; ... 65 more ...; distortionMeasure?: DistortionMeasure | undefined; }.

Return the bounding box of all visible maps in the layer (inside or outside of the Viewport), in longitude/latitude coordinates.

There are no parameters.

Extent | undefined.

  • Bounding box of all warped maps

WarpedMapLayer#getMapDefaultOptions(mapId)

Section titled “WarpedMapLayer#getMapDefaultOptions(mapId)”

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

WebGL2WarpedMapOptions | undefined.

Get mapIds for all maps in the layer

Note: more selection options are available on this function of WarpedMapList

There are no parameters.

The mapIds of all maps (Array<string>).

Get the map-specific options of a map

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

Partial<WebGL2WarpedMapOptions> | 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

WebGL2WarpedMapOptions | undefined.

Get the z-index of a map

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

The z-index of a map (number | undefined).

WarpedMapLayer#getMapsBbox(mapIds, projectionOptions)

Section titled “WarpedMapLayer#getMapsBbox(mapIds, projectionOptions)”

Get the bounding box of all selected maps

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • mapIds (Array<string>)
    • Map IDs
  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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

WarpedMapLayer#getMapsCenter(mapIds, projectionOptions)

Section titled “WarpedMapLayer#getMapsCenter(mapIds, projectionOptions)”

Get the center of the bounding box of all selected maps

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • mapIds (Array<string>)
    • Map IDs
  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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).

WarpedMapLayer#getMapsConvexHull(mapIds, projectionOptions)

Section titled “WarpedMapLayer#getMapsConvexHull(mapIds, projectionOptions)”

Get the convex hull of all selected maps maps

The result is returned in lon-lat EPSG:4326 by default.

Note: more selection options are available on this function of WarpedMapList

  • mapIds (Array<string>)
    • Map IDs
  • projectionOptions? (Partial<ProjectionOptions> | undefined)

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 layer opacity

Returns a number between 0 and 1 (the default)

There are no parameters.

number.

Get the WarpedMap instance for a map

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

WebGL2WarpedMap | undefined.

Get the WarpedMapList object that contains a list of the warped maps of all loaded maps

There are no parameters.

WarpedMapList<WebGL2WarpedMap>.

Get the WarpedMap instances for all maps, or all selected maps

If no argument is passed, the WarpedMap instance of all maps in the layer is passed

Note: more selection options are available on this function of WarpedMapList

  • mapIds? (Array<string> | undefined)
    • Map IDs

The WarpedMap instance of all (selected) map (Array<WebGL2WarpedMap>).

WebGL2RenderingContext

WarpedMapLayer#nativePassWarpedMapEvent(event)

Section titled “WarpedMapLayer#nativePassWarpedMapEvent(event)”
  • event (Event)

void.

There are no parameters.

void.

object & Partial<WebGL2RenderOptions>

WarpedMapLayer#registerProjections(projections)

Section titled “WarpedMapLayer#registerProjections(projections)”

Keep a list of registered projections.

Can optionally be used to complement OpenLayer’s register(proj4) function.

To use viewport projections in OpenLayers, add projections to proj4 and register proj4 (Example: https://openlayers.org/en/latest/examples/scaleline-indiana-east.html). WarpedMapLayer reads the view’s projections code, gets its definition from proj4.defs (thanks to the register() function) and constructs a new Projection type (defined in

  • projections (Array<Projection>)

void.

Map<string, Projection>

There are no parameters.

void.

WarpedMapLayer#removeGeoreferenceAnnotation(annotation)

Section titled “WarpedMapLayer#removeGeoreferenceAnnotation(annotation)”

Removes a Georeference Annotation

  • annotation (unknown)
    • Georeference Annotation

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

WarpedMapLayer#removeGeoreferenceAnnotationByUrl(annotationUrl)

Section titled “WarpedMapLayer#removeGeoreferenceAnnotationByUrl(annotationUrl)”

Removes a Georeference Annotation by URL

  • annotationUrl (string)
    • URL of a Georeference Annotation

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

WarpedMapLayer#removeGeoreferencedMap(georeferencedMap)

Section titled “WarpedMapLayer#removeGeoreferencedMap(georeferencedMap)”

Removes a Georeferenced Map

  • georeferencedMap (unknown)
    • Georeferenced Map

Map ID of the map that was removed (string).

WarpedMapLayer#removeGeoreferencedMapById(mapId)

Section titled “WarpedMapLayer#removeGeoreferencedMapById(mapId)”

Removes a Georeferenced Map by its ID

  • mapId (string)
    • Map ID of the georeferenced map to remove

Map ID of the map that was removed (string).

Render the layer.

  • frameState ({ pixelRatio: number; time: number; viewState: State; animate: boolean; coordinateToPixelTransform: Transform; ... 14 more ...; renderTargets: { [x: string]: boolean; }; })
    • OpenLayers frame state

The rendered element (HTMLElement).

WebGL2Renderer

WarpedMapLayer#resetLayerOptions(layerOptionKeys, animationOptions)

Section titled “WarpedMapLayer#resetLayerOptions(layerOptionKeys, animationOptions)”

Reset the layer options

An empty array resets all options, undefined resets no options. Doesn’t reset render options or specific warped map layer options

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

void.

WarpedMapLayer#resetMapsOptions(mapIds, mapOptionKeys, layerOptionKeys, animationOptions)

Section titled “WarpedMapLayer#resetMapsOptions(mapIds, mapOptionKeys, layerOptionKeys, animationOptions)”

Reset the map-specific options of maps (and the layer options)

An empty array resets all options, undefined resets no options. Doesn’t reset render options or specific warped map layer options

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

void.

WarpedMapLayer#resetMapsOptionsByMapId(mapOptionkeysByMapId, layerOptionKeys, animationOptions)

Section titled “WarpedMapLayer#resetMapsOptionsByMapId(mapOptionkeysByMapId, layerOptionKeys, animationOptions)”

Reset the map-specific options of maps by map ID (and the layer options)

An empty array or map resets all options (for all maps), undefined resets no options. Doesn’t reset render options or specific warped map layer options

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

void.

  • canvas (HTMLCanvasElement)
  • undefined ([number, number])

boolean.

  • entries (Array<ResizeObserverEntry>)

void.

Send maps backward

  • mapIds (Iterable<string>)
    • IDs of the maps

void.

Send maps to back

  • mapIds (Array<string>)
    • IDs of the maps

void.

WarpedMapLayer#setLayerOptions(layerOptions, animationOptions)

Section titled “WarpedMapLayer#setLayerOptions(layerOptions, animationOptions)”

Set the layer options

  • layerOptions (object | Partial<WebGL2RenderOptions>)
    • Layer options to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

warpedMapLayer.setLayerOptions({ transformationType: 'thinPlateSpline' })

WarpedMapLayer#setLayerTransformationType(transformationType, animationOptions)

Section titled “WarpedMapLayer#setLayerTransformationType(transformationType, animationOptions)”

Set the transformation type of the layer

  • transformationType? (TransformationType | undefined)
    • Transformation type to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapLayer#setMapGcps(mapId, gcps, animationOptions)

Section titled “WarpedMapLayer#setMapGcps(mapId, gcps, animationOptions)”

Set the GCPs of a map

This only sets the map-specific gcps option of the map (or more specifically of the warped map used for rendering), overwriting the original GCPs inferred from the Georeference Annotation.

The original GCPs can be reset by resetting the map-specific GCPs option, and stay accessible in the warped map’s map property.

  • mapId (string)
    • Map ID for which to set the options
  • gcps (Array<Gcp>)
    • GCPs to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapLayer#setMapOptions(mapId, mapOptions, layerOptions, animationOptions)

Section titled “WarpedMapLayer#setMapOptions(mapId, mapOptions, layerOptions, animationOptions)”

Set the map-specific options of a map (and the layer options)

In general setting a map-specific option also sets the corresponding option of the map, since these are the result of merging the default, georeferenced map, layer and map-specific options of that map.

A special case is setting a map-specific option to undefined: then the corresponding option is derived from the default, georeferenced map or layer option. This is equivalent to using the reset function for map-specific option.

  • mapId (string)
    • Map ID for which to set the options
  • mapOptions ({ renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; renderGcps?: boolean | undefined; renderGcpsColor?: string | undefined; renderGcpsSize?: number | undefined; renderGcpsBorderColor?: string | undefined; ... 55 more ...; distortionMeasure?: DistortionMeasure | ...)
    • Map-specific options to set
  • layerOptions? (object | Partial<WebGL2RenderOptions> | undefined)
    • Layer options to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

warpedMapLayer.setMapOptions(myMapId, { transformationType: 'thinPlateSpline' })

WarpedMapLayer#setMapResourceMask(mapId, resourceMask, animationOptions)

Section titled “WarpedMapLayer#setMapResourceMask(mapId, resourceMask, animationOptions)”

Set the resource mask of a map

This only sets the map-specific resourceMask option of the map (or more specifically of the warped map used for rendering), overwriting the original resource mask inferred from the Georeference Annotation.

The original resource mask can be reset by resetting the map-specific resource mask option, and stays accessible in the warped map’s map property.

  • mapId (string)
    • Map ID for which to set the options
  • resourceMask (Array<Point>)
    • Resource mask to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapLayer#setMapTransformationType(mapId, transformationType, animationOptions)

Section titled “WarpedMapLayer#setMapTransformationType(mapId, transformationType, animationOptions)”

Set the transformation type of a map

This only sets the map-specific transformationType option of the map (or more specifically of the warped map used for rendering), overwriting the original transformation type inferred from the Georeference Annotation.

The original transformation type can be reset by resetting the map-specific transformation type option, and stays accessible in the warped map’s map property.

  • mapId (string)
    • Map ID for which to set the options
  • transformationType? (TransformationType | undefined)
    • Transformation type to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapLayer#setMapsOptions(mapIds, mapOptions, layerOptions, animationOptions)

Section titled “WarpedMapLayer#setMapsOptions(mapIds, mapOptions, layerOptions, animationOptions)”

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

In general setting a map-specific option also sets the corresponding option of the map, since these are the result of merging the default, georeferenced map, layer and map-specific options of that map.

A special case is setting a map-specific option to undefined: then the corresponding option is derived from the default, georeferenced map or layer option. This is equivalent to using the reset function for map-specific option.

  • mapIds (Array<string>)
    • Map IDs for which to set the options
  • mapOptions ({ renderMaps?: boolean | undefined; renderLines?: boolean | undefined; renderPoints?: boolean | undefined; renderGcps?: boolean | undefined; renderGcpsColor?: string | undefined; renderGcpsSize?: number | undefined; renderGcpsBorderColor?: string | undefined; ... 55 more ...; distortionMeasure?: DistortionMeasure | ...)
    • Map-specific options to set
  • layerOptions? (object | Partial<WebGL2RenderOptions> | undefined)
    • Layer options to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

warpedMapLayer.setMapsOptions([myMapId], { transformationType: 'thinPlateSpline' })

WarpedMapLayer#setMapsOptionsByMapId(mapOptionsByMapId, layerOptions, animationOptions)

Section titled “WarpedMapLayer#setMapsOptionsByMapId(mapOptionsByMapId, layerOptions, animationOptions)”

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

In general setting a map-specific option also sets the corresponding option of the map, since these are the result of merging the default, georeferenced map, layer and map-specific options of that map.

A special case is setting a map-specific option to undefined: then the corresponding option is derived from the default, georeferenced map or layer option. This is equivalent to using the reset function for map-specific option.

  • mapOptionsByMapId (Map<string, Partial<WebGL2WarpedMapOptions>>)
    • Map-specific options to set by map ID
  • layerOptions? (object | Partial<WebGL2RenderOptions> | undefined)
    • Layer options to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

WarpedMapLayer#setMapsTransformationType(mapIds, transformationType, animationOptions)

Section titled “WarpedMapLayer#setMapsTransformationType(mapIds, transformationType, animationOptions)”

Set the transformation type of maps

This only sets the map-specific transformationType option of the map (or more specifically of the warped map used for rendering), overwriting the original transformation type inferred from the Georeference Annotation.

The original transformation type can be reset by resetting the map-specific transformation type option, and stays accessible in the warped map’s map property.

  • mapIds (Array<string>)
    • Map IDs for which to set the options
  • transformationType? (TransformationType | undefined)
    • Transformation type to set
  • animationOptions? (Partial<AnimationOptions> | undefined)
    • Animation options

void.

Set the layer opacity

  • opacity (number)
    • Layer opacity to set

void.