# openseadragon-wmts

> WMTS tile map support for OpenSeadragon

Latest version **1.0.0** (published 2023-03-26) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install openseadragon-wmts
pnpm add openseadragon-wmts
yarn add openseadragon-wmts
bun add openseadragon-wmts
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-03-26 |
| First published | 2021-03-09 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Rainer Simon |
| Maintainers | aboutgeo |

## Links

- npm: https://www.npmjs.com/package/openseadragon-wmts
- Repository: https://github.com/annotorious/openseadragon-wmts
- Homepage: https://github.com/annotorious/openseadragon-wmts#readme
- Issues: https://github.com/annotorious/openseadragon-wmts/issues
- npm.io page: https://npm.io/package/openseadragon-wmts

## Dependencies (2)

- [ol](https://npm.io/package/ol.md) ^6.5.0
- [proj4](https://npm.io/package/proj4.md) ^2.7.2

## Recent versions

- 1.0.0 (latest) — 2023-03-26
- 0.7.1 — 2022-09-19
- 0.7.0 — 2022-07-14
- 0.6.4 — 2022-07-14
- 0.6.3-experimental — 2022-07-14
- 0.6.2 — 2022-07-14
- 0.6.1 — 2022-07-14
- 0.6.0 — 2022-07-14
- 0.5.1 — 2022-07-14
- 0.5.0 — 2022-07-14
- 0.4.0 — 2022-01-21
- 0.3.2 — 2021-10-22
- 0.3.1 — 2021-10-22
- 0.3.0 — 2021-10-22
- 0.2.0 — 2021-10-21
- … 2 more at https://npm.io/package/openseadragon-wmts/versions

## README

# OpenSeadragonWMTS

Adds support for displaying geo-referenced [WMTS tile maps](https://en.wikipedia.org/wiki/Web_Map_Tile_Service)
in OpenSeadragon.

See [online demo](https://annotorious.github.io/openseadragon-wmts).

## Install

Download the [latest release](https://github.com/annotorious/openseadragon-wmts/releases/latest) or grab
directly from the CDN. Import into your page:

```html
<script src="https://cdn.jsdelivr.net/npm/openseadragon-wmts@latest/dist/openseadragon-wmts.umd.cjs"></script>
```

Or install via npm:

```sh
$ npm install openseadragon-wmts
```

## Use

```js
var viewer = OpenSeadragon({
  id: "openseadragon",
  prefixUrl: "https://cdn.jsdelivr.net/npm/openseadragon@2.4/build/openseadragon/images/"
});

// Initialize the plugin
var map = await OpenSeadragonWMTS(viewer, {
  url: 'http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml'
});

// The map object provides functions to convert OSD coordinates to WGS84
var mouseTracker = new OpenSeadragon.MouseTracker({
  element: viewer.container,

  moveHandler: function(event) {
    var viewportPoint = viewer.viewport.pointFromPixel(event.position);

    var lonlat = map.viewportToLonLat(viewportPoint);
    console.log(lonlat);
 }

});

mouseTracker.setTracking(true);
```

Per default, the plugin displays the first available map layer with the default style. To select a specific layer and style:

```js
var map = await OpenSeadragon.WMTS(viewer, {
  url: 'http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml',
  layer: 'Orthofoto 2020',
  style: 'farbe'
});
```

## API

| Method                      | Type          |                                    |
|-----------------------------|---------------|------------------------------------|
| imageToLonLat               | [x, y]        | Image X/Y to lon/lat               |
| lonLatToImageCoordinates    | [lon, lat]    | lon/lat to image X/Y               |
| lonLatToMapCoordinates      | [lon, lat]    | lon/lat to map projection          |
| lonLatToViewportCoordinates | [lon, lat]    | lon/lat to OSD viewport X/Y        |
| mapToLonLat                 | [east, north] | Map projection to lon/lat          |
| mapToViewportCoordinates    | [east, north] | Map projection to OSD viewport X/Y |
| viewportToLonLat            | [x, y]        | OSD viewport X/Y to lon/lat        |
| viewportToMapCoordinates    | [x, y]        | OSD viewport X/Y to map projection |

---
_Source: https://npm.io/package/openseadragon-wmts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
