# @dlr-eoc/utils-maps

> This library contains a collection of utilities for OpenLayers and WebGL.

Latest version **16.0.0** (published 2026-05-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dlr-eoc/utils-maps
pnpm add @dlr-eoc/utils-maps
yarn add @dlr-eoc/utils-maps
bun add @dlr-eoc/utils-maps
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 16.0.0 |
| Published | 2026-05-29 |
| First published | 2020-08-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 330.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 17 |
| Author | Team UKIS |
| Maintainers | dlr-eoc-ukis |
| Keywords | OpenLayers, custom, renderers, WebGL |

## Links

- npm: https://www.npmjs.com/package/@dlr-eoc/utils-maps
- Repository: https://github.com/dlr-eoc/ukis-frontend-libraries
- Homepage: https://github.com/dlr-eoc/ukis-frontend-libraries#readme
- Issues: https://github.com/dlr-eoc/ukis-frontend-libraries/issues
- npm.io page: https://npm.io/package/@dlr-eoc/utils-maps

## Dependencies (3)

- [ol](https://npm.io/package/ol.md) ^v10.9.0
- [tslib](https://npm.io/package/tslib.md) ^2.3.0
- [delaunator](https://npm.io/package/delaunator.md) ^5.0.1

## Recent versions

- 16.0.0 (latest) — 2026-05-29
- 16.0.1-next.3 (next) — 2026-07-01
- 16.0.1-next.2 — 2026-06-15
- 16.0.1-next.1 — 2026-06-09
- 16.0.1-next.0 — 2026-06-05
- 16.0.0-next.9 — 2026-05-05
- 16.0.0-next.8 — 2026-03-16
- 16.0.0-next.7 — 2026-03-10
- 16.0.0-next.6 — 2026-03-06
- 16.0.0-next.5 — 2026-02-27
- 16.0.0-next.4 — 2026-02-26
- 16.0.0-next.3 — 2025-09-09
- 16.0.0-next.2 — 2025-08-01
- 16.0.0-next.0 — 2025-06-17
- 15.0.0 — 2024-12-30
- … 41 more at https://npm.io/package/@dlr-eoc/utils-maps/versions

## README

## dlr-eoc/utils-maps

This library contains a collection of utilities that do not themselves depend on angular.

### ol

Utilities that help in the management of openlayers. 

 - flattenLayers: layers can be arbitrarily nested. This function flattens such a nested collection.

Utilities for copying the images of openlayers' multiple canvases into one, ready to download.
 - mapToSingleCanvas
 - scaledMapToSingleCanvas
 - simpleMapToCanvas

Example usage:
```js
  previewButton.addEventListener('click', () => {
    simpleMapToCanvas(map, previewCanvas, paper.widthPx, paper.heightPx, (updated) => {
        console.log('done');
    });
  });
  downloadButton.addEventListener('click', () => {
     downloadUrl(previewCanvas.toDataURL('image/png'), 'full');
  });
```

Custom renderers. Openlayers allows us to define our own, custom renderers. Currently we have: 
 - `minimal_renderer` contains an absolute minimal example of what is required to create a custom renderer
 - `dtm_renderer` illustrates how WebGL can make use of normal-maps 
 - `particle_renderer` procedurally generates little white particles that move along a force-field (that the user may change at any point)
 - `interpolation_renderer` does an inverse distance interpolation between a set of data-points on a per-pixel basis.


### webgl

This is a simple object-oriented abstraction of the webgl-api.
 - `webgl.ts` contains a very simple wrapper around the native webgl-api-calls. It only attempts to group commonly associated operations and abstract away the details of data-assignment.
 - `engine.core.ts` is a object-oriented wrapper around `webgl.ts`. Creating an instance of the class `Shader` will make sure the programmer has provided all the required attributes, uniforms, textures and indices, and also simplify binding and drawing. There's even some - limited - glsl-parsing to avoid the most common errors in shader-programming.
 - `engine.shapes.ts` contains a few commonly used vertex-primitives like triangles, rectangles, boxes, etc., as well as shape-building helpers like a Bezier-curve creator.


### Development
The `utils` libraries are all designed to have no production dependencies on angular. The primary objective here is to create utilities that can be used in other frameworks or framework-independent. Such utilities might take on the form of libraries of webcomponents. 

Inspired by [clarity-design's shift to a framework-independent core](https://medium.com/claritydesignsystem/clarity-core-72f6d3a029bc), we strive to make those utilities available outside of angular, while at the same time cause minimal disruptions in the current usage of all those outsourced tools.

We intend to obtain this goal by:
 - **Minimal disruptions to the current usage**: When a components or parts of them are moved to a utils-library, we maintain a wrapper that keeps the angular-template syntax. We strive to minimize breaking changes.
 - **Minimal external dependencies**: We hope to make our utils as atomic as possible, meaning that we'll avoid external dependencies where possible. We will, of course, still use very important libraries like openlayers, but avoid others that are less vital.
 - **Unopinionated**: These utilities are intended to be used in any framework. As such, we try to avoid any Angular- or UKIS-specific idioms that might not fit in with another users idea of how a certain tool is best used.
 - **Gradual transition**: As UKIS matures, we will move more and more functionality out of angular-components and into utility-libraries.
 - **Keeping up with web-standards**: One core motivation for the creation of the utils-libraries was our objective of using some functionality of Ukis within other applications (like static site generators, django, CMS etc) as web components. As a consequence, we intend to design the utilities with modern web-standards and -api's in mind.

---
_Source: https://npm.io/package/@dlr-eoc/utils-maps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
