@northtech/openlayers-tools

TypeScript utilities for OpenLayers

Usage no npm install needed!

<script type="module">
  import northtechOpenlayersTools from 'https://cdn.skypack.dev/@northtech/openlayers-tools';
</script>

README

@northtech/openlayers-tools

A toolbox for working with OpenLayers, in particular with RxJs-based event handling.

Generally speaking, this library contains two different types of utilities:

  • Stateless functions, ranging from mnemonics to boilerplate (parsing Capabilities into actual layers) to animation support.
  • Classes which work directly on/with an OpenLayers Map or View. These classes can be instantiated without a Map, but will only start functioning once their .setMap(...)/.setView(...) function has been called. This way, they can be instantiated early and, say, become part of a dependency injection hierarchy or central "Map Service", even if the actual map they will work on has not been created yet. (Such as when the map is based on a live Capabilities file which needs to be fetched asynchronously).

Usage

Install with

npm install @northtech/openlayers-tools@^1

Install peer dependencies if needed:

npm install ol@^6.10 proj4@^2.7 @types/proj4@^2.5 rxjs@^7

TypeDocs at https://doc.northtech.dk/openlayers-tools/